pub trait DaemonApi: Sized {
Show 23 methods
// Required methods
async fn aranya_local_addr(self, context: Context) -> Result<SocketAddr>;
async fn get_key_bundle(self, context: Context) -> Result<KeyBundle>;
async fn get_device_id(self, context: Context) -> Result<DeviceId>;
async fn add_sync_peer(
self,
context: Context,
addr: Addr,
team: TeamId,
interval: Duration,
) -> Result<()>;
async fn remove_sync_peer(
self,
context: Context,
addr: Addr,
team: TeamId,
) -> Result<()>;
async fn add_team(self, context: Context, team: TeamId) -> Result<()>;
async fn remove_team(self, context: Context, team: TeamId) -> Result<()>;
async fn create_team(self, context: Context) -> Result<TeamId>;
async fn close_team(self, context: Context, team: TeamId) -> Result<()>;
async fn add_device_to_team(
self,
context: Context,
team: TeamId,
keys: KeyBundle,
) -> Result<()>;
async fn remove_device_from_team(
self,
context: Context,
team: TeamId,
device: DeviceId,
) -> Result<()>;
async fn assign_role(
self,
context: Context,
team: TeamId,
device: DeviceId,
role: Role,
) -> Result<()>;
async fn revoke_role(
self,
context: Context,
team: TeamId,
device: DeviceId,
role: Role,
) -> Result<()>;
async fn assign_net_identifier(
self,
context: Context,
team: TeamId,
device: DeviceId,
name: NetIdentifier,
) -> Result<()>;
async fn remove_net_identifier(
self,
context: Context,
team: TeamId,
device: DeviceId,
name: NetIdentifier,
) -> Result<()>;
async fn create_label(
self,
context: Context,
team: TeamId,
label: Label,
) -> Result<()>;
async fn delete_label(
self,
context: Context,
team: TeamId,
label: Label,
) -> Result<()>;
async fn assign_label(
self,
context: Context,
team: TeamId,
device: DeviceId,
label: Label,
) -> Result<()>;
async fn revoke_label(
self,
context: Context,
team: TeamId,
device: DeviceId,
label: Label,
) -> Result<()>;
async fn create_bidi_channel(
self,
context: Context,
team: TeamId,
peer: NetIdentifier,
node_id: NodeId,
label: Label,
) -> Result<(AfcId, AfcCtrl)>;
async fn delete_channel(
self,
context: Context,
chan: AfcId,
) -> Result<AfcCtrl>;
async fn receive_afc_ctrl(
self,
context: Context,
team: TeamId,
node_id: NodeId,
ctrl: AfcCtrl,
) -> Result<(AfcId, Label)>;
// Provided method
fn serve(self) -> ServeDaemonApi<Self> { ... }
}Required Methods§
Sourceasync fn aranya_local_addr(self, context: Context) -> Result<SocketAddr>
async fn aranya_local_addr(self, context: Context) -> Result<SocketAddr>
Gets local address the Aranya sync server is bound to.
Sourceasync fn get_key_bundle(self, context: Context) -> Result<KeyBundle>
async fn get_key_bundle(self, context: Context) -> Result<KeyBundle>
Gets the public key bundle for this device
Sourceasync fn get_device_id(self, context: Context) -> Result<DeviceId>
async fn get_device_id(self, context: Context) -> Result<DeviceId>
Gets the public device id.
Sourceasync fn add_sync_peer(
self,
context: Context,
addr: Addr,
team: TeamId,
interval: Duration,
) -> Result<()>
async fn add_sync_peer( self, context: Context, addr: Addr, team: TeamId, interval: Duration, ) -> Result<()>
Adds the peer for automatic periodic syncing.
Sourceasync fn remove_sync_peer(
self,
context: Context,
addr: Addr,
team: TeamId,
) -> Result<()>
async fn remove_sync_peer( self, context: Context, addr: Addr, team: TeamId, ) -> Result<()>
Removes the peer from automatic syncing.
Sourceasync fn add_team(self, context: Context, team: TeamId) -> Result<()>
async fn add_team(self, context: Context, team: TeamId) -> Result<()>
add a team to the local device store that was created by someone else. Not an aranya action/command.
Sourceasync fn remove_team(self, context: Context, team: TeamId) -> Result<()>
async fn remove_team(self, context: Context, team: TeamId) -> Result<()>
remove a team from the local device store.
Sourceasync fn create_team(self, context: Context) -> Result<TeamId>
async fn create_team(self, context: Context) -> Result<TeamId>
Create a new graph/team with the current device as the owner.
Sourceasync fn add_device_to_team(
self,
context: Context,
team: TeamId,
keys: KeyBundle,
) -> Result<()>
async fn add_device_to_team( self, context: Context, team: TeamId, keys: KeyBundle, ) -> Result<()>
Add device to the team.
Sourceasync fn remove_device_from_team(
self,
context: Context,
team: TeamId,
device: DeviceId,
) -> Result<()>
async fn remove_device_from_team( self, context: Context, team: TeamId, device: DeviceId, ) -> Result<()>
Remove device from the team.
Sourceasync fn assign_role(
self,
context: Context,
team: TeamId,
device: DeviceId,
role: Role,
) -> Result<()>
async fn assign_role( self, context: Context, team: TeamId, device: DeviceId, role: Role, ) -> Result<()>
Assign a role to a device.
Sourceasync fn revoke_role(
self,
context: Context,
team: TeamId,
device: DeviceId,
role: Role,
) -> Result<()>
async fn revoke_role( self, context: Context, team: TeamId, device: DeviceId, role: Role, ) -> Result<()>
Revoke a role from a device.
Sourceasync fn assign_net_identifier(
self,
context: Context,
team: TeamId,
device: DeviceId,
name: NetIdentifier,
) -> Result<()>
async fn assign_net_identifier( self, context: Context, team: TeamId, device: DeviceId, name: NetIdentifier, ) -> Result<()>
Assign a network identifier to a device.
Sourceasync fn remove_net_identifier(
self,
context: Context,
team: TeamId,
device: DeviceId,
name: NetIdentifier,
) -> Result<()>
async fn remove_net_identifier( self, context: Context, team: TeamId, device: DeviceId, name: NetIdentifier, ) -> Result<()>
Remove a network identifier from a device.
Sourceasync fn create_label(
self,
context: Context,
team: TeamId,
label: Label,
) -> Result<()>
async fn create_label( self, context: Context, team: TeamId, label: Label, ) -> Result<()>
Create a fast channels label.
Sourceasync fn delete_label(
self,
context: Context,
team: TeamId,
label: Label,
) -> Result<()>
async fn delete_label( self, context: Context, team: TeamId, label: Label, ) -> Result<()>
Delete a fast channels label.
Sourceasync fn assign_label(
self,
context: Context,
team: TeamId,
device: DeviceId,
label: Label,
) -> Result<()>
async fn assign_label( self, context: Context, team: TeamId, device: DeviceId, label: Label, ) -> Result<()>
Assign a fast channels label to a device.
Sourceasync fn revoke_label(
self,
context: Context,
team: TeamId,
device: DeviceId,
label: Label,
) -> Result<()>
async fn revoke_label( self, context: Context, team: TeamId, device: DeviceId, label: Label, ) -> Result<()>
Revoke a fast channels label from a device.
Sourceasync fn create_bidi_channel(
self,
context: Context,
team: TeamId,
peer: NetIdentifier,
node_id: NodeId,
label: Label,
) -> Result<(AfcId, AfcCtrl)>
async fn create_bidi_channel( self, context: Context, team: TeamId, peer: NetIdentifier, node_id: NodeId, label: Label, ) -> Result<(AfcId, AfcCtrl)>
Create a fast channel.
Provided Methods§
Sourcefn serve(self) -> ServeDaemonApi<Self>
fn serve(self) -> ServeDaemonApi<Self>
Returns a serving function to use with InFlightRequest::execute.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.