pub struct AnnouncementData { /* private fields */ }Expand description
Structure containing data used for an on-chain announcement.
That is an optional decapsulated multiaddress (with the /p2p/{peer_id} suffix removed) and
mandatory keybinding KeyBinding.
NOTE: This currently supports only announcing of a single multiaddress
Implementations§
Source§impl AnnouncementData
impl AnnouncementData
Sourcepub fn new(
key_binding: KeyBinding,
multiaddress: Option<Multiaddr>,
) -> Result<Self, GeneralError>
pub fn new( key_binding: KeyBinding, multiaddress: Option<Multiaddr>, ) -> Result<Self, GeneralError>
Constructs structure from optional multiaddress and also KeyBinding.
The multiaddress must not be empty if present. It should be the external address of the node.
It may contain a trailing PeerId (encapsulated multiaddr) or come without. If the
peerId is present, it must match with the keybinding.
Sourcepub fn multiaddress(&self) -> Option<&Multiaddr>
pub fn multiaddress(&self) -> Option<&Multiaddr>
Returns the optional multiaddress associated with this announcement.
Note that the returned multiaddress is always decapsulated (= without the /p2p/<peer_id> suffix)
Sourcepub fn key_binding(&self) -> &KeyBinding
pub fn key_binding(&self) -> &KeyBinding
Returns the key binding with this announcement.
Trait Implementations§
Source§impl Clone for AnnouncementData
impl Clone for AnnouncementData
Source§fn clone(&self) -> AnnouncementData
fn clone(&self) -> AnnouncementData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnnouncementData
impl Debug for AnnouncementData
Source§impl Display for AnnouncementData
impl Display for AnnouncementData
Source§impl PartialEq for AnnouncementData
impl PartialEq for AnnouncementData
impl Eq for AnnouncementData
impl StructuralPartialEq for AnnouncementData
Auto Trait Implementations§
impl Freeze for AnnouncementData
impl RefUnwindSafe for AnnouncementData
impl Send for AnnouncementData
impl Sync for AnnouncementData
impl Unpin for AnnouncementData
impl UnwindSafe for AnnouncementData
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,
§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