Struct libp2p_rendezvous::Cookie
source · [−]pub struct Cookie { /* private fields */ }Implementations
sourceimpl 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 StructuralEq for Cookie
impl StructuralPartialEq for Cookie
Auto Trait Implementations
impl RefUnwindSafe for Cookie
impl Send for Cookie
impl Sync for Cookie
impl Unpin for Cookie
impl UnwindSafe for Cookie
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