Skip to main content

request_access

Function request_access 

Source
pub fn request_access(
    http_base: &str,
    client_id: &str,
    description: &str,
    permissions: Permissions,
    trust: &Trust,
) -> Result<Requested, ClientError>
Expand description

Asks a server for a token.

client_id identifies this installation and must stay the same across restarts: it is what the administrator sees in the list, and asking again under a new name would put a second entry in front of them.

Asking again under the same name while an earlier request is still unanswered is refused by the server – restarting mid-wait reaches this, not just misuse – and comes back as Requested::AlreadyPending rather than as an error, since it is functionally the same situation as still waiting, not a new kind of failure.

§Errors

If the server cannot be reached, or answers something this cannot make sense of at all.