Trait DaemonApi

Source
pub trait DaemonApi: Sized {
Show 34 methods // Required methods async fn version(self, context: Context) -> Result<Version>; 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, config: SyncPeerConfig, ) -> Result<()>; async fn sync_now( self, context: Context, addr: Addr, team: TeamId, cfg: Option<SyncPeerConfig>, ) -> Result<()>; async fn remove_sync_peer( self, context: Context, addr: Addr, team: TeamId, ) -> Result<()>; async fn add_team( self, context: Context, team: TeamId, cfg: TeamConfig, ) -> Result<()>; async fn remove_team(self, context: Context, team: TeamId) -> Result<()>; async fn create_team( self, context: Context, cfg: TeamConfig, ) -> 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_aqc_net_identifier( self, context: Context, team: TeamId, device: DeviceId, name: NetIdentifier, ) -> Result<()>; async fn remove_aqc_net_identifier( self, context: Context, team: TeamId, device: DeviceId, name: NetIdentifier, ) -> Result<()>; async fn create_label( self, context: Context, team: TeamId, name: String, ) -> Result<LabelId>; async fn delete_label( self, context: Context, team: TeamId, label_id: LabelId, ) -> Result<()>; async fn assign_label( self, context: Context, team: TeamId, device: DeviceId, label_id: LabelId, op: ChanOp, ) -> Result<()>; async fn revoke_label( self, context: Context, team: TeamId, device: DeviceId, label_id: LabelId, ) -> Result<()>; async fn create_aqc_bidi_channel( self, context: Context, team: TeamId, peer: NetIdentifier, label_id: LabelId, ) -> Result<(AqcCtrl, AqcBidiPsks)>; async fn create_aqc_uni_channel( self, context: Context, team: TeamId, peer: NetIdentifier, label_id: LabelId, ) -> Result<(AqcCtrl, AqcUniPsks)>; async fn delete_aqc_bidi_channel( self, context: Context, chan: AqcBidiChannelId, ) -> Result<AqcCtrl>; async fn delete_aqc_uni_channel( self, context: Context, chan: AqcUniChannelId, ) -> Result<AqcCtrl>; async fn receive_aqc_ctrl( self, context: Context, team: TeamId, ctrl: AqcCtrl, ) -> Result<(LabelId, AqcPsks)>; async fn query_devices_on_team( self, context: Context, team: TeamId, ) -> Result<Vec<DeviceId>>; async fn query_device_role( self, context: Context, team: TeamId, device: DeviceId, ) -> Result<Role>; async fn query_device_keybundle( self, context: Context, team: TeamId, device: DeviceId, ) -> Result<KeyBundle>; async fn query_device_label_assignments( self, context: Context, team: TeamId, device: DeviceId, ) -> Result<Vec<Label>>; async fn query_aqc_net_identifier( self, context: Context, team: TeamId, device: DeviceId, ) -> Result<Option<NetIdentifier>>; async fn query_labels( self, context: Context, team: TeamId, ) -> Result<Vec<Label>>; async fn query_label_exists( self, context: Context, team: TeamId, label: LabelId, ) -> Result<bool>; // Provided method fn serve(self) -> ServeDaemonApi<Self> { ... }
}

Required Methods§

Source

async fn version(self, context: Context) -> Result<Version>

Returns the daemon’s version.

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, config: SyncPeerConfig, ) -> Result<()>

Adds the peer for automatic periodic syncing.

Source

async fn sync_now( self, context: Context, addr: Addr, team: TeamId, cfg: Option<SyncPeerConfig>, ) -> Result<()>

Sync with peer immediately.

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, cfg: TeamConfig, ) -> 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, cfg: TeamConfig) -> 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_aqc_net_identifier( self, context: Context, team: TeamId, device: DeviceId, name: NetIdentifier, ) -> Result<()>

Assign a QUIC channels network identifier to a device.

Source

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

Remove a QUIC channels network identifier from a device.

Source

async fn create_label( self, context: Context, team: TeamId, name: String, ) -> Result<LabelId>

Source

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

Source

async fn assign_label( self, context: Context, team: TeamId, device: DeviceId, label_id: LabelId, op: ChanOp, ) -> Result<()>

Source

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

Source

async fn create_aqc_bidi_channel( self, context: Context, team: TeamId, peer: NetIdentifier, label_id: LabelId, ) -> Result<(AqcCtrl, AqcBidiPsks)>

Create a bidirectional QUIC channel.

Source

async fn create_aqc_uni_channel( self, context: Context, team: TeamId, peer: NetIdentifier, label_id: LabelId, ) -> Result<(AqcCtrl, AqcUniPsks)>

Create a unidirectional QUIC channel.

Source

async fn delete_aqc_bidi_channel( self, context: Context, chan: AqcBidiChannelId, ) -> Result<AqcCtrl>

Delete a QUIC bidi channel.

Source

async fn delete_aqc_uni_channel( self, context: Context, chan: AqcUniChannelId, ) -> Result<AqcCtrl>

Delete a QUIC uni channel.

Source

async fn receive_aqc_ctrl( self, context: Context, team: TeamId, ctrl: AqcCtrl, ) -> Result<(LabelId, AqcPsks)>

Receive AQC ctrl message.

Source

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

Query devices on team.

Source

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

Query device role.

Source

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

Query device keybundle.

Source

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

Query device label assignments.

Source

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

Query AQC network ID.

Source

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

Source

async fn query_label_exists( self, context: Context, team: TeamId, label: LabelId, ) -> Result<bool>

Query whether a label exists.

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§