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§
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,
config: SyncPeerConfig,
) -> Result<()>
async fn add_sync_peer( self, context: Context, addr: Addr, team: TeamId, config: SyncPeerConfig, ) -> Result<()>
Adds the peer for automatic periodic syncing.
Sourceasync fn sync_now(
self,
context: Context,
addr: Addr,
team: TeamId,
cfg: Option<SyncPeerConfig>,
) -> Result<()>
async fn sync_now( self, context: Context, addr: Addr, team: TeamId, cfg: Option<SyncPeerConfig>, ) -> Result<()>
Sync with peer immediately.
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,
cfg: TeamConfig,
) -> Result<()>
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.
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, cfg: TeamConfig) -> Result<TeamId>
async fn create_team(self, context: Context, cfg: TeamConfig) -> 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_aqc_net_identifier(
self,
context: Context,
team: TeamId,
device: DeviceId,
name: NetIdentifier,
) -> Result<()>
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.
Sourceasync fn remove_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<()>
Remove a QUIC channels network identifier from a device.
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<()>
Sourceasync fn create_aqc_bidi_channel(
self,
context: Context,
team: TeamId,
peer: NetIdentifier,
label_id: LabelId,
) -> Result<(AqcCtrl, AqcBidiPsks)>
async fn create_aqc_bidi_channel( self, context: Context, team: TeamId, peer: NetIdentifier, label_id: LabelId, ) -> Result<(AqcCtrl, AqcBidiPsks)>
Create a bidirectional QUIC channel.
Sourceasync fn create_aqc_uni_channel(
self,
context: Context,
team: TeamId,
peer: NetIdentifier,
label_id: LabelId,
) -> Result<(AqcCtrl, AqcUniPsks)>
async fn create_aqc_uni_channel( self, context: Context, team: TeamId, peer: NetIdentifier, label_id: LabelId, ) -> Result<(AqcCtrl, AqcUniPsks)>
Create a unidirectional QUIC channel.
Sourceasync fn delete_aqc_bidi_channel(
self,
context: Context,
chan: AqcBidiChannelId,
) -> Result<AqcCtrl>
async fn delete_aqc_bidi_channel( self, context: Context, chan: AqcBidiChannelId, ) -> Result<AqcCtrl>
Delete a QUIC bidi channel.
Sourceasync fn delete_aqc_uni_channel(
self,
context: Context,
chan: AqcUniChannelId,
) -> Result<AqcCtrl>
async fn delete_aqc_uni_channel( self, context: Context, chan: AqcUniChannelId, ) -> Result<AqcCtrl>
Delete a QUIC uni channel.
Sourceasync fn receive_aqc_ctrl(
self,
context: Context,
team: TeamId,
ctrl: AqcCtrl,
) -> Result<(LabelId, AqcPsks)>
async fn receive_aqc_ctrl( self, context: Context, team: TeamId, ctrl: AqcCtrl, ) -> Result<(LabelId, AqcPsks)>
Receive AQC ctrl message.
Sourceasync fn query_devices_on_team(
self,
context: Context,
team: TeamId,
) -> Result<Vec<DeviceId>>
async fn query_devices_on_team( self, context: Context, team: TeamId, ) -> Result<Vec<DeviceId>>
Query devices on team.
Sourceasync fn query_device_role(
self,
context: Context,
team: TeamId,
device: DeviceId,
) -> Result<Role>
async fn query_device_role( self, context: Context, team: TeamId, device: DeviceId, ) -> Result<Role>
Query device role.
Sourceasync fn query_device_keybundle(
self,
context: Context,
team: TeamId,
device: DeviceId,
) -> Result<KeyBundle>
async fn query_device_keybundle( self, context: Context, team: TeamId, device: DeviceId, ) -> Result<KeyBundle>
Query device keybundle.
Sourceasync fn query_device_label_assignments(
self,
context: Context,
team: TeamId,
device: DeviceId,
) -> Result<Vec<Label>>
async fn query_device_label_assignments( self, context: Context, team: TeamId, device: DeviceId, ) -> Result<Vec<Label>>
Query device label assignments.
Sourceasync fn query_aqc_net_identifier(
self,
context: Context,
team: TeamId,
device: DeviceId,
) -> Result<Option<NetIdentifier>>
async fn query_aqc_net_identifier( self, context: Context, team: TeamId, device: DeviceId, ) -> Result<Option<NetIdentifier>>
Query AQC network ID.
async fn query_labels( self, context: Context, team: TeamId, ) -> Result<Vec<Label>>
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.