pub struct CsvHandleResolver(/* private fields */);Available on crate features
csv and std only.Expand description
A CSV file resolver from ASIMOV handles to peer IDs.
The format of the CSV file is simply handle,peer_id.
The records should be sorted for efficient resolution.
The file is read line-by-line, so it can be very large.
Implementations§
Trait Implementations§
Source§impl From<AsyncReader<File>> for CsvHandleResolver
impl From<AsyncReader<File>> for CsvHandleResolver
Source§fn from(reader: AsyncReader<File>) -> Self
fn from(reader: AsyncReader<File>) -> Self
Converts to this type from the input type.
Source§impl ResolveHandle for CsvHandleResolver
impl ResolveHandle for CsvHandleResolver
Source§fn resolve_handle(
&mut self,
handle: impl Into<Handle>,
) -> impl Stream<Item = Result<PeerId>> + Send
fn resolve_handle( &mut self, handle: impl Into<Handle>, ) -> impl Stream<Item = Result<PeerId>> + Send
Resolves a handle into a set of endpoint IDs.
type Error = Error
Source§fn resolve_random(
&mut self,
id: impl Into<Id>,
) -> impl Future<Output = Result<Option<PeerId>, Self::Error>>
fn resolve_random( &mut self, id: impl Into<Id>, ) -> impl Future<Output = Result<Option<PeerId>, Self::Error>>
Resolves an ASIMOV ID and yields a random known peer ID.
Ignores any erroneous results, sampling from only successful results. Read more
Auto Trait Implementations§
impl !Freeze for CsvHandleResolver
impl !RefUnwindSafe for CsvHandleResolver
impl Send for CsvHandleResolver
impl Sync for CsvHandleResolver
impl Unpin for CsvHandleResolver
impl UnsafeUnpin for CsvHandleResolver
impl UnwindSafe for CsvHandleResolver
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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