Skip to main content

Module scopes

Module scopes 

Source
Expand description

Sealed scope-set type family for crate::PcsExternalClient<S>.

The four scope sets map to the OAuth2 scopes your app requested when calling PasTokenUrl with the client_credentials grant. Methods on crate::PcsExternalClient are gated by capability marker traits (SendAlertCapable, GetSendStatusCapable) so calling a method your app isn’t authorised for is a compile-time error (E0277), not a runtime rejection.

§Compile-time enforcement example

use pcs_external::{PcsExternalClient, scopes::ReadOnly};

fn try_send(client: &PcsExternalClient<ReadOnly>) {
    // send_alert requires SendAlertCapable; ReadOnly doesn't satisfy it.
    // This line must not compile.
    let _ = client.send_alert(todo!(), todo!(), None);
}

Structs§

FullAccess
Full access: all methods.
ReadAndSend
Read + send: send_alert + get_send_status.
ReadOnly
Read-only access: get_send_status only.
SendOnly
Send-only access: send_alert only. Used by RCW notification adapter.

Traits§

GetSendStatusCapable
Capability marker: scope set may call get_send_status.
PcsExternalScopeSet
Parent marker for all PCS External API scope sets.
SendAlertCapable
Capability marker: scope set may call send_alert.