Struct everscale_network::dht::Entry
source · [−]pub struct Entry<'a> { /* private fields */ }Implementations
sourceimpl<'a> Entry<'a>
impl<'a> Entry<'a>
sourcepub fn with_key_index(self, idx: u32) -> Self
pub fn with_key_index(self, idx: u32) -> Self
Sets the key index. Default: 0
sourcepub fn with_data<T>(self, data: T) -> EntryWithData<'a>where
T: TlWrite<Repr = Boxed>,
pub fn with_data<T>(self, data: T) -> EntryWithData<'a>where
T: TlWrite<Repr = Boxed>,
Creates a new builder which can store the value in the DHT.
See Entry::with_data_raw for raw API
sourcepub fn with_data_raw(self, data: &'a [u8]) -> EntryWithData<'a>
pub fn with_data_raw(self, data: &'a [u8]) -> EntryWithData<'a>
Creates a new builder which can store the value in the DHT.
See Entry::with_data for more convenient API
sourcepub fn values<T>(self) -> DhtValuesStream<T>where
for<'tl> T: TlRead<'tl, Repr = Boxed> + Send + 'static,
pub fn values<T>(self) -> DhtValuesStream<T>where
for<'tl> T: TlRead<'tl, Repr = Boxed> + Send + 'static,
Returns a stream of values for this entry.
sourcepub async fn value_from<T>(
self,
peer_id: &NodeIdShort
) -> Result<Option<(KeyDescriptionOwned, T)>>where
for<'tl> T: TlRead<'tl, Repr = Boxed> + Send + 'static,
pub async fn value_from<T>(
self,
peer_id: &NodeIdShort
) -> Result<Option<(KeyDescriptionOwned, T)>>where
for<'tl> T: TlRead<'tl, Repr = Boxed> + Send + 'static,
Queries a value from the given peer.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Entry<'a>
impl<'a> Send for Entry<'a>
impl<'a> Sync for Entry<'a>
impl<'a> Unpin for Entry<'a>
impl<'a> !UnwindSafe for Entry<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more