aranya_daemon_api

Trait DaemonApi

Source
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§

Source

async fn aranya_local_addr(self, context: Context) -> Result<SocketAddr>

Gets local address the Aranya sync server is bound to.

Source

async fn get_key_bundle(self, context: Context) -> Result<KeyBundle>

Gets the public key bundle for this device

Source

async fn get_device_id(self, context: Context) -> Result<DeviceId>

Gets the public device id.

Source

async fn add_sync_peer( self, context: Context, addr: Addr, team: TeamId, interval: Duration, ) -> Result<()>

Adds the peer for automatic periodic syncing.

Source

async fn remove_sync_peer( self, context: Context, addr: Addr, team: TeamId, ) -> Result<()>

Removes the peer from automatic syncing.

Source

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.

Source

async fn remove_team(self, context: Context, team: TeamId) -> Result<()>

remove a team from the local device store.

Source

async fn create_team(self, context: Context) -> Result<TeamId>

Create a new graph/team with the current device as the owner.

Source

async fn close_team(self, context: Context, team: TeamId) -> Result<()>

Close the team.

Source

async fn add_device_to_team( self, context: Context, team: TeamId, keys: KeyBundle, ) -> Result<()>

Add device to the team.

Source

async fn remove_device_from_team( self, context: Context, team: TeamId, device: DeviceId, ) -> Result<()>

Remove device from the team.

Source

async fn assign_role( self, context: Context, team: TeamId, device: DeviceId, role: Role, ) -> Result<()>

Assign a role to a device.

Source

async fn revoke_role( self, context: Context, team: TeamId, device: DeviceId, role: Role, ) -> Result<()>

Revoke a role from a device.

Source

async fn assign_net_identifier( self, context: Context, team: TeamId, device: DeviceId, name: NetIdentifier, ) -> Result<()>

Assign a network identifier to a device.

Source

async fn remove_net_identifier( self, context: Context, team: TeamId, device: DeviceId, name: NetIdentifier, ) -> Result<()>

Remove a network identifier from a device.

Source

async fn create_label( self, context: Context, team: TeamId, label: Label, ) -> Result<()>

Create a fast channels label.

Source

async fn delete_label( self, context: Context, team: TeamId, label: Label, ) -> Result<()>

Delete a fast channels label.

Source

async fn assign_label( self, context: Context, team: TeamId, device: DeviceId, label: Label, ) -> Result<()>

Assign a fast channels label to a device.

Source

async fn revoke_label( self, context: Context, team: TeamId, device: DeviceId, label: Label, ) -> Result<()>

Revoke a fast channels label from a device.

Source

async fn create_bidi_channel( self, context: Context, team: TeamId, peer: NetIdentifier, node_id: NodeId, label: Label, ) -> Result<(AfcId, AfcCtrl)>

Create a fast channel.

Source

async fn delete_channel(self, context: Context, chan: AfcId) -> Result<AfcCtrl>

Delete a fast channel.

Source

async fn receive_afc_ctrl( self, context: Context, team: TeamId, node_id: NodeId, ctrl: AfcCtrl, ) -> Result<(AfcId, Label)>

Receive a fast channel ctrl message.

Provided Methods§

Source

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.

Implementors§