pub struct Handle { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl Handle for Handle
impl Handle for Handle
type Events = Events
type Event = Event
Source§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Check if the node is running.
Source§fn connect(
&mut self,
node: NodeId,
addr: Address,
opts: ConnectOptions,
) -> Result<ConnectResult, Error>
fn connect( &mut self, node: NodeId, addr: Address, opts: ConnectOptions, ) -> Result<ConnectResult, Error>
Connect to a peer.
Source§fn seeds(&mut self, id: RepoId) -> Result<Seeds, Self::Error>
fn seeds(&mut self, id: RepoId) -> Result<Seeds, Self::Error>
Lookup the seeds of a given repository in the routing table.
Source§fn listen_addrs(&self) -> Result<Vec<SocketAddr>, Self::Error>
fn listen_addrs(&self) -> Result<Vec<SocketAddr>, Self::Error>
Get the node’s bound listen addresses.
Source§fn fetch(
&mut self,
id: RepoId,
from: NodeId,
timeout: Duration,
) -> Result<FetchResult, Error>
fn fetch( &mut self, id: RepoId, from: NodeId, timeout: Duration, ) -> Result<FetchResult, Error>
Fetch a repository from the network.
Source§fn follow(&mut self, id: NodeId, alias: Option<Alias>) -> Result<bool, Error>
fn follow(&mut self, id: NodeId, alias: Option<Alias>) -> Result<bool, Error>
Start following the given peer.
Source§fn seed(&mut self, id: RepoId, scope: Scope) -> Result<bool, Error>
fn seed(&mut self, id: RepoId, scope: Scope) -> Result<bool, Error>
Start seeding the given repo. May update the scope. Does nothing if the
repo is already seeded.
Source§fn unseed(&mut self, id: RepoId) -> Result<bool, Error>
fn unseed(&mut self, id: RepoId) -> Result<bool, Error>
Un-seed the given repo and delete it from storage.
Source§fn announce_refs(&mut self, id: RepoId) -> Result<RefsAt, Error>
fn announce_refs(&mut self, id: RepoId) -> Result<RefsAt, Error>
Notify the service that a project has been updated, and announce local refs.
Source§fn add_inventory(&mut self, rid: RepoId) -> Result<bool, Error>
fn add_inventory(&mut self, rid: RepoId) -> Result<bool, Error>
Notify the service that our inventory was updated with the given repository.
Source§fn subscribe(&self, _timeout: Duration) -> Result<Self::Events, Self::Error>
fn subscribe(&self, _timeout: Duration) -> Result<Self::Events, Self::Error>
Subscribe to node events.
Auto Trait Implementations§
impl Freeze for Handle
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
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§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