pub struct Credential { /* private fields */ }Expand description
One credential this side presented, returned by Handle’s add.
Cheap to clone, and every clone names the same credential. It stays presented on
every session of its handle until the last clone drops, which closes its streams and
removes its grant from the union. A Route holding one keeps
it presented while the route stands, across the handle’s sessions.
Implementations§
Source§impl Credential
impl Credential
Sourcepub fn grant(&self) -> Watch
pub fn grant(&self) -> Watch
This credential’s own grant on the live session: None until its peer answers,
while no session is live, forever on moq-transport without AUTH, and again once
the credential ends.
Sourcepub async fn closed(&self) -> Error
pub async fn closed(&self) -> Error
Wait for the credential to end for good: a peer’s refusal or revocation as
Error::Session, Error::Cancel when the peer closed it without one, or the
handle’s end. A session ending is not one: the next session presents it again.
Sourcepub fn poll_answered(&self, waiter: &Waiter) -> Poll<Result<()>>
pub fn poll_answered(&self, waiter: &Waiter) -> Poll<Result<()>>
Wait for the peer’s first verdict on the token: Ok once a peer accepts it, at once on
moq-transport without AUTH, where only a request that names it carries the token.
§Errors
Error::Unsupported when neither the session nor its requests can carry a token
(moq-lite without AUTH, or a peer that takes no tokens in band), the peer’s refusal as
Error::Session, or the handle’s end.
Sourcepub async fn answered(&self) -> Result<()>
pub async fn answered(&self) -> Result<()>
Wait for the peer’s first verdict on the token: Ok once a peer accepts it, at once on
moq-transport without AUTH, where only a request that names it carries the token.
§Errors
Error::Unsupported when neither the session nor its requests can carry a token
(moq-lite without AUTH, or a peer that takes no tokens in band), the peer’s refusal as
Error::Session, or the handle’s end.
Awaits poll_answered.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Credential
impl RefUnwindSafe for Credential
impl Send for Credential
impl Sync for Credential
impl Unpin for Credential
impl UnsafeUnpin for Credential
impl UnwindSafe for Credential
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.