pub enum Caller {
LocalApp {
app: String,
peer: PeerIdentity,
},
Device {
id: String,
scopes: BTreeSet<Scope>,
},
}Expand description
Who is making a request.
Variants§
LocalApp
A local app on this machine. app is the label declared in hello (a claim, an allowlist
key); peer is what the OS verified about the other end.
Device
A remote device identified by its id, with the scopes it was enrolled with.
Implementations§
Source§impl Caller
impl Caller
pub fn local_app(app: impl Into<String>, peer: PeerIdentity) -> Self
pub fn device<I, S>(id: impl Into<String>, scopes: I) -> Self
Sourcepub fn peer(&self) -> Option<&PeerIdentity>
pub fn peer(&self) -> Option<&PeerIdentity>
The OS-verified peer, for a local caller only.
Sourcepub fn role(&self) -> Option<&str>
pub fn role(&self) -> Option<&str>
The role of a device caller (see ROLE_SCOPE_PREFIX); None for a local app, for a
device with no role scope and for one with more than one.
Trait Implementations§
impl Eq for Caller
impl StructuralPartialEq for Caller
Auto Trait Implementations§
impl Freeze for Caller
impl RefUnwindSafe for Caller
impl Send for Caller
impl Sync for Caller
impl Unpin for Caller
impl UnsafeUnpin for Caller
impl UnwindSafe for Caller
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more