pub enum Message {
Subscribe(Subscribe),
Announcement(Announcement),
Info(Info),
Ping(Ping),
Pong {
zeroes: ZeroBytes,
},
}
Expand description
Message payload. These are the messages peers send to each other.
Variants§
Subscribe(Subscribe)
Subscribe to gossip messages matching the filter and time range.
Announcement(Announcement)
Gossip announcement. These messages are relayed to peers, and filtered
using Message::Subscribe
.
Info(Info)
Informational message. These messages are sent between peers for information and do not need to be acted upon. They can be safely ignored, though handling them can be useful for the user.
Ping(Ping)
Ask a connected peer for a Pong.
Used to check if the remote peer is responsive, or a side-effect free way to keep a connection alive.
Pong
Response to Ping
message.
Implementations§
Source§impl Message
impl Message
pub fn announcement( node: PublicKey, message: impl Into<AnnouncementMessage>, signature: Signature, ) -> Message
pub fn node<G>(message: NodeAnnouncement, signer: &Device<G>) -> Message
pub fn inventory<G>( message: InventoryAnnouncement, signer: &Device<G>, ) -> Message
pub fn subscribe(filter: Filter, since: Timestamp, until: Timestamp) -> Message
pub fn log(&self, level: Level, remote: &PublicKey, link: Link)
Trait Implementations§
Source§impl From<Announcement> for Message
impl From<Announcement> for Message
Source§fn from(ann: Announcement) -> Message
fn from(ann: Announcement) -> Message
Converts to this type from the input type.
Source§impl Ord for Message
impl Ord for Message
Source§impl PartialOrd for Message
impl PartialOrd for Message
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Converts
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>
Converts
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