pub struct ParkedKeys {
ttl: Duration,
held: Mutex<BTreeMap<(String, String), ParkedKey>>,
}Expand description
Keys parked at this server, in memory, keyed by name and fingerprint.
Several keys may be parked under one name at once, so parking is not a way to hold a name against the machine that wants it: the operator admits one by its fingerprint, which is what the registering machine printed.
Nothing lists them: a park is looked up by the name the operator was told, and a name nobody was told is not guessable from here.
Fields§
§ttl: Duration§held: Mutex<BTreeMap<(String, String), ParkedKey>>Implementations§
Source§impl ParkedKeys
impl ParkedKeys
Sourcepub fn park(
&self,
name: &str,
kind: AccountKind,
key: &str,
now: OffsetDateTime,
) -> Result<ParkedKey, OffsetDateTime>
pub fn park( &self, name: &str, kind: AccountKind, key: &str, now: OffsetDateTime, ) -> Result<ParkedKey, OffsetDateTime>
Parks key under name, or answers when the park this same key
already has there lapses.
Another key parked under the same name is no obstacle: both wait, and the operator admits the fingerprint they were shown.
Sourcepub fn describe(
&self,
name: &str,
fingerprint: Option<&str>,
now: OffsetDateTime,
) -> Option<ParkedKey>
pub fn describe( &self, name: &str, fingerprint: Option<&str>, now: OffsetDateTime, ) -> Option<ParkedKey>
The live park under name whose fingerprint is fingerprint, or,
with none given, the one made most recently.
One answer, because bot.did.describeParkedKey returns one park.
A caller that knows which key it means names it; the newest is what
a caller that names none is shown.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ParkedKeys
impl RefUnwindSafe for ParkedKeys
impl Send for ParkedKeys
impl Sync for ParkedKeys
impl Unpin for ParkedKeys
impl UnsafeUnpin for ParkedKeys
impl UnwindSafe for ParkedKeys
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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