pub enum Command {
Show 15 variants
AnnounceRefs(RepoId, HashSet<PublicKey>, Responder<RefsAt>),
AnnounceInventory,
AddInventory(RepoId, Responder<bool>),
Connect(NodeId, Address, ConnectOptions),
Disconnect(NodeId),
Config(Responder<Config>),
ListenAddrs(Responder<Vec<SocketAddr>>),
Seeds(RepoId, HashSet<PublicKey>, Responder<Seeds>),
Fetch(RepoId, NodeId, Duration, Option<FeatureLevel>, Responder<FetchResult>),
Seed(RepoId, Scope, Responder<bool>),
Unseed(RepoId, Responder<bool>),
Follow(NodeId, Option<Alias>, Responder<bool>),
Unfollow(NodeId, Responder<bool>),
Block(NodeId, Sender<bool>),
QueryState(Arc<QueryState>, Sender<Result<()>>),
}Expand description
Commands sent to the service by the operator.
Each variant has a corresponding helper constructor, e.g. Command::Seed
and Command::seed. These constructors will hide the construction of the
Responder, and return the corresponding Receiver to receive the
result of the command process.
If the command does not return a Responder, then it will only return the
Command variant, e.g. Command::AnnounceInventory.
Variants§
AnnounceRefs(RepoId, HashSet<PublicKey>, Responder<RefsAt>)
Announce repository references for given repository and namespaces to peers.
AnnounceInventory
Announce local repositories to peers.
AddInventory(RepoId, Responder<bool>)
Add repository to local inventory.
Connect(NodeId, Address, ConnectOptions)
Connect to node with the given address.
Disconnect(NodeId)
Disconnect from node.
Config(Responder<Config>)
Get the node configuration.
ListenAddrs(Responder<Vec<SocketAddr>>)
Get the node’s listen addresses.
Seeds(RepoId, HashSet<PublicKey>, Responder<Seeds>)
Lookup seeds for the given repository in the routing table, and report sync status for given namespaces.
Fetch(RepoId, NodeId, Duration, Option<FeatureLevel>, Responder<FetchResult>)
Fetch the given repository from the network.
Seed(RepoId, Scope, Responder<bool>)
Seed the given repository.
Unseed(RepoId, Responder<bool>)
Unseed the given repository.
Follow(NodeId, Option<Alias>, Responder<bool>)
Follow the given node.
Unfollow(NodeId, Responder<bool>)
Unfollow the given node.
Block(NodeId, Sender<bool>)
Block the given node.
QueryState(Arc<QueryState>, Sender<Result<()>>)
Query the internal service state.
Implementations§
Source§impl Command
impl Command
pub fn announce_refs( rid: RepoId, keys: HashSet<PublicKey>, ) -> (Self, Receiver<Result<RefsAt>>)
pub fn announce_inventory() -> Self
pub fn add_inventory(rid: RepoId) -> (Self, Receiver<Result<bool>>)
pub fn connect( node_id: NodeId, address: Address, options: ConnectOptions, ) -> Self
pub fn disconnect(node_id: NodeId) -> Self
pub fn config() -> (Self, Receiver<Result<Config>>)
pub fn listen_addrs() -> (Self, Receiver<Result<Vec<SocketAddr>>>)
pub fn seeds( rid: RepoId, keys: HashSet<PublicKey>, ) -> (Self, Receiver<Result<Seeds>>)
pub fn fetch( rid: RepoId, node_id: NodeId, duration: Duration, signed_references_minimum_feature_level: Option<FeatureLevel>, ) -> (Self, Receiver<Result<FetchResult>>)
pub fn seed(rid: RepoId, scope: Scope) -> (Self, Receiver<Result<bool>>)
pub fn unseed(rid: RepoId) -> (Self, Receiver<Result<bool>>)
pub fn follow( node_id: NodeId, alias: Option<Alias>, ) -> (Self, Receiver<Result<bool>>)
pub fn unfollow(node_id: NodeId) -> (Self, Receiver<Result<bool>>)
pub fn query_state(state: Arc<QueryState>, sender: Sender<Result<()>>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Command
impl !RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl !UnwindSafe for Command
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
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>
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>
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