Enum MessageAuthenticity
pub enum MessageAuthenticity {
Signed(Keypair),
Author(PeerId),
RandomAuthor,
Anonymous,
}
gossipsub
only.Expand description
Determines if published messages should be signed or not.
Without signing, a number of privacy preserving modes can be selected.
NOTE: The default validation settings are to require signatures. The ValidationMode
should be updated in the Config
to allow for unsigned messages.
Variants§
Signed(Keypair)
Message signing is enabled. The author will be the owner of the key and the sequence number will be linearly increasing.
Author(PeerId)
Message signing is disabled.
The specified PeerId
will be used as the author of all published messages. The sequence
number will be randomized.
RandomAuthor
Message signing is disabled.
A random PeerId
will be used when publishing each message. The sequence number will be
randomized.
Anonymous
Message signing is disabled.
The author of the message and the sequence numbers are excluded from the message.
NOTE: Excluding these fields may make these messages invalid by other nodes who
enforce validation of these fields. See ValidationMode
in the Config
for how to customise this for rust-libp2p gossipsub. A custom message_id
function will need to be set to prevent all messages from a peer being filtered
as duplicates.
Implementations§
§impl MessageAuthenticity
impl MessageAuthenticity
pub fn is_signing(&self) -> bool
pub fn is_signing(&self) -> bool
Returns true if signing is enabled.
pub fn is_anonymous(&self) -> bool
Trait Implementations§
§impl Clone for MessageAuthenticity
impl Clone for MessageAuthenticity
§fn clone(&self) -> MessageAuthenticity
fn clone(&self) -> MessageAuthenticity
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 MessageAuthenticity
impl RefUnwindSafe for MessageAuthenticity
impl Send for MessageAuthenticity
impl Sync for MessageAuthenticity
impl Unpin for MessageAuthenticity
impl UnwindSafe for MessageAuthenticity
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> 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,
§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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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