pub struct PeerGrant {
pub scope: Scope,
pub mutates: bool,
pub recovery: Recovery,
pub max_sensitivity: Sensitivity,
pub output_sensitivity: Sensitivity,
pub retry: RetryPolicy,
/* private fields */
}Expand description
What the operator grants a peer.
Fields§
§scope: ScopeThe authority this peer may hold. Narrowed further by the caller’s own scope at every hop — a grant is a ceiling, not an entitlement.
mutates: boolWhether a call to this peer changes the world.
recovery: Recovery§max_sensitivity: Sensitivity§output_sensitivity: Sensitivity§retry: RetryPolicyImplementations§
Source§impl PeerGrant
impl PeerGrant
Sourcepub fn new(scope: Scope) -> Self
pub fn new(scope: Scope) -> Self
A grant with the conservative posture: mutating, operator-resolved.
Sourcepub fn with_credential(self, peer: &PeerId, credential: PeerCredential) -> Self
pub fn with_credential(self, peer: &PeerId, credential: PeerCredential) -> Self
Attach the credential this peer is called with.
§Panics
If the credential’s audience is not this peer. That is a configuration error the operator must see at startup rather than a refusal at 3am, and there is no sensible way to continue: the alternative is holding a credential that can only ever be sent to the wrong place.
Sourcepub fn with_source(self, source: Arc<dyn CredentialSource>) -> Self
pub fn with_source(self, source: Arc<dyn CredentialSource>) -> Self
Call this peer with a credential naming the person each run acts for,
obtained from source when the call is made.
From then on a run that acts for nobody is refused this peer rather
than sent out under the plane’s name, and the credential held through
with_credential, if any, is presented only
for a run admitted as the plane.
Sourcepub fn source(&self) -> Option<&Arc<dyn CredentialSource>>
pub fn source(&self) -> Option<&Arc<dyn CredentialSource>>
Where this peer’s subject-bound credentials come from, if it has one.
pub fn read_only(self) -> Self
pub const fn output_sensitivity(self, s: Sensitivity) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PeerGrant
impl !UnwindSafe for PeerGrant
impl Freeze for PeerGrant
impl Send for PeerGrant
impl Sync for PeerGrant
impl Unpin for PeerGrant
impl UnsafeUnpin for PeerGrant
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more