DaemonApi

Trait DaemonApi 

Source
pub trait DaemonApi: Sized {
Show 27 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, cfg: AddTeamConfig) -> Result<()>; async fn remove_team(self, context: Context, team: TeamId) -> Result<()>; async fn create_team( self, context: Context, cfg: CreateTeamConfig, ) -> Result<TeamId>; async fn close_team(self, context: Context, team: TeamId) -> Result<()>; async fn encrypt_psk_seed_for_peer( self, context: Context, team: TeamId, peer_enc_pk: EncryptionPublicKey<CS>, ) -> Result<WrappedSeed>; 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 create_label( self, context: Context, team: TeamId, name: Text, ) -> 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 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_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, cfg: AddTeamConfig) -> 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 local device storage.

Source

async fn create_team( self, context: Context, cfg: CreateTeamConfig, ) -> 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 encrypt_psk_seed_for_peer( self, context: Context, team: TeamId, peer_enc_pk: EncryptionPublicKey<CS>, ) -> Result<WrappedSeed>

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 create_label( self, context: Context, team: TeamId, name: Text, ) -> 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 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_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§