pub struct KeyPathInfoBuilder {
summary: Option<String>,
role: Option<String>,
extra_info: Option<BTreeMap<String, String>>,
}
Expand description
Builder for KeyPathInfo
.
Fields§
§summary: Option<String>
A human-readable summary string describing what the KeyPath
is for.
This should not recapitulate information in the extra_info
.
role: Option<String>
The key role, ie its official name in the Tor Protocols.
This should usually start with KS_
.
extra_info: Option<BTreeMap<String, String>>
Additional information, in the form of key-value pairs.
This will contain human-readable information that describes the individual
components of a KeyPath. For example, for the ArtiPath
hs/foo/KS_hs_id.expanded_ed25519_private
, the extra information could
be ("kind", "service)
, ("nickname", "foo")
, etc.
Implementations§
Source§impl KeyPathInfoBuilder
impl KeyPathInfoBuilder
Sourcepub fn summary(&mut self, value: String) -> &mut Self
pub fn summary(&mut self, value: String) -> &mut Self
A human-readable summary string describing what the KeyPath
is for.
This should not recapitulate information in the extra_info
.
Sourcepub fn role(&mut self, value: String) -> &mut Self
pub fn role(&mut self, value: String) -> &mut Self
The key role, ie its official name in the Tor Protocols.
This should usually start with KS_
.
Sourcepub fn build(&self) -> Result<KeyPathInfo, KeyPathInfoBuilderError>
pub fn build(&self) -> Result<KeyPathInfo, KeyPathInfoBuilderError>
Sourcefn create_empty() -> Self
fn create_empty() -> Self
Create an empty builder, with all fields set to None
or PhantomData
.
Source§impl KeyPathInfoBuilder
impl KeyPathInfoBuilder
Sourcepub fn set_all_extra_info(
&mut self,
all_extra_info: impl Iterator<Item = (String, String)>,
) -> &mut Self
pub fn set_all_extra_info( &mut self, all_extra_info: impl Iterator<Item = (String, String)>, ) -> &mut Self
Initialize the additional information of this builder with the specified values.
Erases the preexisting extra_info
.
Trait Implementations§
Source§impl Clone for KeyPathInfoBuilder
impl Clone for KeyPathInfoBuilder
Source§fn clone(&self) -> KeyPathInfoBuilder
fn clone(&self) -> KeyPathInfoBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for KeyPathInfoBuilder
impl RefUnwindSafe for KeyPathInfoBuilder
impl Send for KeyPathInfoBuilder
impl Sync for KeyPathInfoBuilder
impl Unpin for KeyPathInfoBuilder
impl UnwindSafe for KeyPathInfoBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for 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