Struct tor_netdir::testprovider::TestNetDirProvider
source · pub struct TestNetDirProvider { /* private fields */ }
Available on crate feature
testing
only.Expand description
Helper implementation of a NetDirProvider
.
A TestNetDirProvider
can be used to provide a netdir in a single
situation that requires a NetDirProvider
. It does not yet notify its
owner of any changes; it only provides a NetDir
.
Implementations§
source§impl TestNetDirProvider
impl TestNetDirProvider
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new TestNetDirProvider
with no netdir available.
sourcepub fn set_netdir(&self, dir: impl Into<Arc<NetDir>>)
pub fn set_netdir(&self, dir: impl Into<Arc<NetDir>>)
Replace the NetDir
in this TestNetDirProvider
.
Trait Implementations§
source§impl Debug for TestNetDirProvider
impl Debug for TestNetDirProvider
source§impl Default for TestNetDirProvider
impl Default for TestNetDirProvider
source§fn default() -> TestNetDirProvider
fn default() -> TestNetDirProvider
Returns the “default value” for a type. Read more
source§impl From<NetDir> for TestNetDirProvider
impl From<NetDir> for TestNetDirProvider
source§impl NetDirProvider for TestNetDirProvider
impl NetDirProvider for TestNetDirProvider
source§fn netdir(&self, _timeliness: Timeliness) -> Result<Arc<NetDir>>
fn netdir(&self, _timeliness: Timeliness) -> Result<Arc<NetDir>>
Return a network directory that’s live according to the provided
timeliness
.source§fn events(&self) -> BoxStream<'static, DirEvent>
fn events(&self) -> BoxStream<'static, DirEvent>
Return a new asynchronous stream that will receive notification
whenever the consensus has changed. Read more
Auto Trait Implementations§
impl !Freeze for TestNetDirProvider
impl RefUnwindSafe for TestNetDirProvider
impl Send for TestNetDirProvider
impl Sync for TestNetDirProvider
impl Unpin for TestNetDirProvider
impl UnwindSafe for TestNetDirProvider
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> 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> UpcastArcNetDirProvider for Twhere
T: NetDirProvider,
impl<T> UpcastArcNetDirProvider for Twhere
T: NetDirProvider,
source§fn upcast_arc<'a>(self: Arc<T>) -> Arc<dyn NetDirProvider + 'a>where
T: 'a,
fn upcast_arc<'a>(self: Arc<T>) -> Arc<dyn NetDirProvider + 'a>where
T: 'a,
Return a view of this object as an
Arc<dyn NetDirProvider>