Struct reth_network_peers::WithPeerId
source · pub struct WithPeerId<T>(_, pub T);
Expand description
Generic wrapper with peer id
Tuple Fields§
§1: T
Implementations§
source§impl<T> WithPeerId<T>
impl<T> WithPeerId<T>
sourcepub fn transform<F: From<T>>(self) -> WithPeerId<F>
pub fn transform<F: From<T>>(self) -> WithPeerId<F>
Transform the data
sourcepub fn map<U, F: FnOnce(T) -> U>(self, op: F) -> WithPeerId<U>
pub fn map<U, F: FnOnce(T) -> U>(self, op: F) -> WithPeerId<U>
Maps the inner value to a new value using the given function.
source§impl<T> WithPeerId<Option<T>>
impl<T> WithPeerId<Option<T>>
sourcepub fn transpose(self) -> Option<WithPeerId<T>>
pub fn transpose(self) -> Option<WithPeerId<T>>
returns None
if the inner value is None
, otherwise returns Some(WithPeerId<T>)
.
Trait Implementations§
source§impl<T: Debug> Debug for WithPeerId<T>
impl<T: Debug> Debug for WithPeerId<T>
Auto Trait Implementations§
impl<T> Freeze for WithPeerId<T>where
T: Freeze,
impl<T> RefUnwindSafe for WithPeerId<T>where
T: RefUnwindSafe,
impl<T> Send for WithPeerId<T>where
T: Send,
impl<T> Sync for WithPeerId<T>where
T: Sync,
impl<T> Unpin for WithPeerId<T>where
T: Unpin,
impl<T> UnwindSafe for WithPeerId<T>where
T: UnwindSafe,
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
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.