pub struct AnnouncementData {
pub key_binding: Option<KeyBinding>,
/* private fields */
}
Expand description
Structure containing data used for an on-chain announcement.
That is the decapsulated multiaddress (with the /p2p/{peer_id} suffix removed) and
optional KeyBinding
(an announcement can be done with key bindings or without)
NOTE: This currently supports only announcing of a single multiaddress
Fields§
§key_binding: Option<KeyBinding>
Implementations§
Source§impl AnnouncementData
impl AnnouncementData
Sourcepub fn new(
multiaddress: Multiaddr,
key_binding: Option<KeyBinding>,
) -> Result<Self, GeneralError>
pub fn new( multiaddress: Multiaddr, key_binding: Option<KeyBinding>, ) -> Result<Self, GeneralError>
Constructs structure from multiaddress and optionally also KeyBinding
.
The multiaddress must not be empty. 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) -> &Multiaddr
pub fn multiaddress(&self) -> &Multiaddr
Returns the multiaddress associated with this announcement. Note that the returned multiaddress is always decapsulated (= without the /p2p/<peer_id> suffix)
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 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> 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§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.