pub struct DaemonApiClient<Stub = Channel<DaemonApiRequest, DaemonApiResponse>>(/* private fields */);Expand description
The client stub that makes RPC calls to the server. All request methods return Futures.
Implementations§
Source§impl DaemonApiClient
impl DaemonApiClient
Sourcepub fn new<T>(
config: Config,
transport: T,
) -> NewClient<Self, RequestDispatch<DaemonApiRequest, DaemonApiResponse, T>>
pub fn new<T>( config: Config, transport: T, ) -> NewClient<Self, RequestDispatch<DaemonApiRequest, DaemonApiResponse, T>>
Returns a new client stub that sends requests over the given transport.
Source§impl<Stub> DaemonApiClient<Stub>
impl<Stub> DaemonApiClient<Stub>
Sourcepub fn version(
&self,
ctx: Context,
) -> impl Future<Output = Result<Result<Version>, RpcError>> + '_
pub fn version( &self, ctx: Context, ) -> impl Future<Output = Result<Result<Version>, RpcError>> + '_
Returns the daemon’s version.
Sourcepub fn aranya_local_addr(
&self,
ctx: Context,
) -> impl Future<Output = Result<Result<Addr>, RpcError>> + '_
pub fn aranya_local_addr( &self, ctx: Context, ) -> impl Future<Output = Result<Result<Addr>, RpcError>> + '_
Gets local address the Aranya sync server is bound to.
Sourcepub fn get_key_bundle(
&self,
ctx: Context,
) -> impl Future<Output = Result<Result<KeyBundle>, RpcError>> + '_
pub fn get_key_bundle( &self, ctx: Context, ) -> impl Future<Output = Result<Result<KeyBundle>, RpcError>> + '_
Gets the public key bundle for this device
Sourcepub fn get_device_id(
&self,
ctx: Context,
) -> impl Future<Output = Result<Result<DeviceId>, RpcError>> + '_
pub fn get_device_id( &self, ctx: Context, ) -> impl Future<Output = Result<Result<DeviceId>, RpcError>> + '_
Gets the public device id.
Sourcepub fn add_sync_peer(
&self,
ctx: Context,
addr: Addr,
team: TeamId,
config: SyncPeerConfig,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn add_sync_peer( &self, ctx: Context, addr: Addr, team: TeamId, config: SyncPeerConfig, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Adds the peer for automatic periodic syncing.
Sourcepub fn sync_now(
&self,
ctx: Context,
addr: Addr,
team: TeamId,
cfg: Option<SyncPeerConfig>,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn sync_now( &self, ctx: Context, addr: Addr, team: TeamId, cfg: Option<SyncPeerConfig>, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Sync with peer immediately.
Sourcepub fn remove_sync_peer(
&self,
ctx: Context,
addr: Addr,
team: TeamId,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn remove_sync_peer( &self, ctx: Context, addr: Addr, team: TeamId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Removes the peer from automatic syncing.
Sourcepub fn add_team(
&self,
ctx: Context,
cfg: AddTeamConfig,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn add_team( &self, ctx: Context, cfg: AddTeamConfig, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
add a team to the local device store that was created by someone else. Not an aranya action/command.
Sourcepub fn remove_team(
&self,
ctx: Context,
team: TeamId,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn remove_team( &self, ctx: Context, team: TeamId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Remove a team from local device storage.
Sourcepub fn create_team(
&self,
ctx: Context,
cfg: CreateTeamConfig,
) -> impl Future<Output = Result<Result<TeamId>, RpcError>> + '_
pub fn create_team( &self, ctx: Context, cfg: CreateTeamConfig, ) -> impl Future<Output = Result<Result<TeamId>, RpcError>> + '_
Create a new graph/team with the current device as the owner.
Sourcepub fn close_team(
&self,
ctx: Context,
team: TeamId,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn close_team( &self, ctx: Context, team: TeamId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Close the team.
Sourcepub fn encrypt_psk_seed_for_peer(
&self,
ctx: Context,
team: TeamId,
peer_enc_pk: EncryptionPublicKey<CS>,
) -> impl Future<Output = Result<Result<WrappedSeed>, RpcError>> + '_
pub fn encrypt_psk_seed_for_peer( &self, ctx: Context, team: TeamId, peer_enc_pk: EncryptionPublicKey<CS>, ) -> impl Future<Output = Result<Result<WrappedSeed>, RpcError>> + '_
Encrypts the team’s syncing PSK(s) for the peer.
Sourcepub fn add_device_to_team(
&self,
ctx: Context,
team: TeamId,
keys: KeyBundle,
initial_role: Option<RoleId>,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn add_device_to_team( &self, ctx: Context, team: TeamId, keys: KeyBundle, initial_role: Option<RoleId>, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Adds a device to the team with optional initial roles.
Sourcepub fn remove_device_from_team(
&self,
ctx: Context,
team: TeamId,
device: DeviceId,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn remove_device_from_team( &self, ctx: Context, team: TeamId, device: DeviceId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Remove device from the team.
Sourcepub fn devices_on_team(
&self,
ctx: Context,
team: TeamId,
) -> impl Future<Output = Result<Result<Box<[DeviceId]>>, RpcError>> + '_
pub fn devices_on_team( &self, ctx: Context, team: TeamId, ) -> impl Future<Output = Result<Result<Box<[DeviceId]>>, RpcError>> + '_
Returns all the devices on the team.
Sourcepub fn device_keybundle(
&self,
ctx: Context,
team: TeamId,
device: DeviceId,
) -> impl Future<Output = Result<Result<KeyBundle>, RpcError>> + '_
pub fn device_keybundle( &self, ctx: Context, team: TeamId, device: DeviceId, ) -> impl Future<Output = Result<Result<KeyBundle>, RpcError>> + '_
Returns the device’s key bundle.
Sourcepub fn setup_default_roles(
&self,
ctx: Context,
team: TeamId,
owning_role: RoleId,
) -> impl Future<Output = Result<Result<Box<[Role]>>, RpcError>> + '_
pub fn setup_default_roles( &self, ctx: Context, team: TeamId, owning_role: RoleId, ) -> impl Future<Output = Result<Result<Box<[Role]>>, RpcError>> + '_
Configures the team with default roles from policy.
It returns the default roles that were created.
Sourcepub fn team_roles(
&self,
ctx: Context,
team: TeamId,
) -> impl Future<Output = Result<Result<Box<[Role]>>, RpcError>> + '_
pub fn team_roles( &self, ctx: Context, team: TeamId, ) -> impl Future<Output = Result<Result<Box<[Role]>>, RpcError>> + '_
Returns the current team roles.
Sourcepub fn role_owners(
&self,
ctx: Context,
team: TeamId,
role: RoleId,
) -> impl Future<Output = Result<Result<Box<[Role]>>, RpcError>> + '_
pub fn role_owners( &self, ctx: Context, team: TeamId, role: RoleId, ) -> impl Future<Output = Result<Result<Box<[Role]>>, RpcError>> + '_
Returns the roles that own the target role.
Sourcepub fn assign_role(
&self,
ctx: Context,
team: TeamId,
device: DeviceId,
role: RoleId,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn assign_role( &self, ctx: Context, team: TeamId, device: DeviceId, role: RoleId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Assign a role to a device.
Sourcepub fn revoke_role(
&self,
ctx: Context,
team: TeamId,
device: DeviceId,
role: RoleId,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn revoke_role( &self, ctx: Context, team: TeamId, device: DeviceId, role: RoleId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Revoke a role from a device.
Sourcepub fn change_role(
&self,
ctx: Context,
team: TeamId,
device: DeviceId,
old_role: RoleId,
new_role: RoleId,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn change_role( &self, ctx: Context, team: TeamId, device: DeviceId, old_role: RoleId, new_role: RoleId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Changes the assigned role of a device.
Sourcepub fn device_role(
&self,
ctx: Context,
team: TeamId,
device: DeviceId,
) -> impl Future<Output = Result<Result<Option<Role>>, RpcError>> + '_
pub fn device_role( &self, ctx: Context, team: TeamId, device: DeviceId, ) -> impl Future<Output = Result<Result<Option<Role>>, RpcError>> + '_
Returns the role assigned to the device.
Sourcepub fn create_label(
&self,
ctx: Context,
team: TeamId,
name: Text,
managing_role_id: RoleId,
) -> impl Future<Output = Result<Result<LabelId>, RpcError>> + '_
pub fn create_label( &self, ctx: Context, team: TeamId, name: Text, managing_role_id: RoleId, ) -> impl Future<Output = Result<Result<LabelId>, RpcError>> + '_
Create a label.
Sourcepub fn delete_label(
&self,
ctx: Context,
team: TeamId,
label_id: LabelId,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn delete_label( &self, ctx: Context, team: TeamId, label_id: LabelId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Delete a label.
Sourcepub fn label(
&self,
ctx: Context,
team: TeamId,
label: LabelId,
) -> impl Future<Output = Result<Result<Option<Label>>, RpcError>> + '_
pub fn label( &self, ctx: Context, team: TeamId, label: LabelId, ) -> impl Future<Output = Result<Result<Option<Label>>, RpcError>> + '_
Returns a specific label.
Sourcepub fn labels(
&self,
ctx: Context,
team: TeamId,
) -> impl Future<Output = Result<Result<Vec<Label>>, RpcError>> + '_
pub fn labels( &self, ctx: Context, team: TeamId, ) -> impl Future<Output = Result<Result<Vec<Label>>, RpcError>> + '_
Returns all labels on the team.
pub fn add_label_managing_role( &self, ctx: Context, team: TeamId, label_id: LabelId, managing_role_id: RoleId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Sourcepub fn assign_label_to_device(
&self,
ctx: Context,
team: TeamId,
device: DeviceId,
label: LabelId,
op: ChanOp,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn assign_label_to_device( &self, ctx: Context, team: TeamId, device: DeviceId, label: LabelId, op: ChanOp, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Assigns a label to a device.
Sourcepub fn revoke_label_from_device(
&self,
ctx: Context,
team: TeamId,
device: DeviceId,
label: LabelId,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
pub fn revoke_label_from_device( &self, ctx: Context, team: TeamId, device: DeviceId, label: LabelId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Revokes a label from a device.
Sourcepub fn labels_assigned_to_device(
&self,
ctx: Context,
team: TeamId,
device: DeviceId,
) -> impl Future<Output = Result<Result<Box<[Label]>>, RpcError>> + '_
pub fn labels_assigned_to_device( &self, ctx: Context, team: TeamId, device: DeviceId, ) -> impl Future<Output = Result<Result<Box<[Label]>>, RpcError>> + '_
Returns all labels assigned to the device.
Sourcepub fn afc_shm_info(
&self,
ctx: Context,
) -> impl Future<Output = Result<Result<AfcShmInfo>, RpcError>> + '_
Available on crate feature afc only.
pub fn afc_shm_info( &self, ctx: Context, ) -> impl Future<Output = Result<Result<AfcShmInfo>, RpcError>> + '_
afc only.Gets AFC shared-memory configuration info.
Sourcepub fn create_afc_channel(
&self,
ctx: Context,
team: TeamId,
peer_id: DeviceId,
label_id: LabelId,
) -> impl Future<Output = Result<Result<AfcSendChannelInfo>, RpcError>> + '_
Available on crate feature afc only.
pub fn create_afc_channel( &self, ctx: Context, team: TeamId, peer_id: DeviceId, label_id: LabelId, ) -> impl Future<Output = Result<Result<AfcSendChannelInfo>, RpcError>> + '_
afc only.Create a send-only AFC channel.
Sourcepub fn delete_afc_channel(
&self,
ctx: Context,
chan: AfcLocalChannelId,
) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
Available on crate feature afc only.
pub fn delete_afc_channel( &self, ctx: Context, chan: AfcLocalChannelId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_
afc only.Delete a AFC channel.
Sourcepub fn accept_afc_channel(
&self,
ctx: Context,
team: TeamId,
ctrl: AfcCtrl,
) -> impl Future<Output = Result<Result<AfcReceiveChannelInfo>, RpcError>> + '_
Available on crate feature afc only.
pub fn accept_afc_channel( &self, ctx: Context, team: TeamId, ctrl: AfcCtrl, ) -> impl Future<Output = Result<Result<AfcReceiveChannelInfo>, RpcError>> + '_
afc only.Accept a receive-only AFC channel by processing a peer’s ctrl message.
Trait Implementations§
Source§impl<Stub: Clone> Clone for DaemonApiClient<Stub>
impl<Stub: Clone> Clone for DaemonApiClient<Stub>
Source§fn clone(&self) -> DaemonApiClient<Stub>
fn clone(&self) -> DaemonApiClient<Stub>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Stub: Debug> Debug for DaemonApiClient<Stub>
impl<Stub: Debug> Debug for DaemonApiClient<Stub>
Source§impl<Stub> From<Stub> for DaemonApiClient<Stub>
impl<Stub> From<Stub> for DaemonApiClient<Stub>
Auto Trait Implementations§
impl<Stub> Freeze for DaemonApiClient<Stub>where
Stub: Freeze,
impl<Stub> RefUnwindSafe for DaemonApiClient<Stub>where
Stub: RefUnwindSafe,
impl<Stub> Send for DaemonApiClient<Stub>where
Stub: Send,
impl<Stub> Sync for DaemonApiClient<Stub>where
Stub: Sync,
impl<Stub> Unpin for DaemonApiClient<Stub>where
Stub: Unpin,
impl<Stub> UnwindSafe for DaemonApiClient<Stub>where
Stub: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.