Struct libp2p::gossipsub::IdentityTransform
source · [−]pub struct IdentityTransform;
Expand description
The default transform, the raw data is propagated as is to the application layer gossipsub.
Trait Implementations
sourceimpl Clone for IdentityTransform
impl Clone for IdentityTransform
sourcepub fn clone(&self) -> IdentityTransform
pub fn clone(&self) -> IdentityTransform
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl DataTransform for IdentityTransform
impl DataTransform for IdentityTransform
sourcepub fn inbound_transform(
&self,
raw_message: RawGossipsubMessage
) -> Result<GossipsubMessage, Error>
pub fn inbound_transform(
&self,
raw_message: RawGossipsubMessage
) -> Result<GossipsubMessage, Error>
Takes a RawGossipsubMessage
received and converts it to a GossipsubMessage
.
sourcepub fn outbound_transform(
&self,
_topic: &TopicHash,
data: Vec<u8, Global>
) -> Result<Vec<u8, Global>, Error>
pub fn outbound_transform(
&self,
_topic: &TopicHash,
data: Vec<u8, Global>
) -> Result<Vec<u8, Global>, Error>
Takes the data to be published (a topic and associated data) transforms the data. The
transformed data will then be used to create a crate::RawGossipsubMessage
to be sent to peers. Read more
sourceimpl Default for IdentityTransform
impl Default for IdentityTransform
sourcepub fn default() -> IdentityTransform
pub fn default() -> IdentityTransform
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for IdentityTransform
impl Send for IdentityTransform
impl Sync for IdentityTransform
impl Unpin for IdentityTransform
impl UnwindSafe for IdentityTransform
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more