Struct libp2p_rendezvous::Cookie
source · pub struct Cookie { /* private fields */ }
Implementations§
source§impl Cookie
impl Cookie
sourcepub fn for_namespace(namespace: Namespace) -> Self
pub fn for_namespace(namespace: Namespace) -> Self
Construct a new Cookie
for a given namespace.
This cookie will only be valid for subsequent DISCOVER requests targeting the same namespace.
sourcepub fn for_all_namespaces() -> Self
pub fn for_all_namespaces() -> Self
Construct a new Cookie
for a DISCOVER request that inquires about all namespaces.
pub fn into_wire_encoding(self) -> Vec<u8>
pub fn from_wire_encoding(bytes: Vec<u8>) -> Result<Self, InvalidCookie>
pub fn namespace(&self) -> Option<&Namespace>
Trait Implementations§
impl Eq for Cookie
impl StructuralPartialEq for Cookie
Auto Trait Implementations§
impl Freeze for Cookie
impl RefUnwindSafe for Cookie
impl Send for Cookie
impl Sync for Cookie
impl Unpin for Cookie
impl UnwindSafe for Cookie
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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