DaemonApiClient

Struct DaemonApiClient 

Source
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

Source

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>
where Stub: Stub<Req = DaemonApiRequest, Resp = DaemonApiResponse>,

Source

pub fn version( &self, ctx: Context, ) -> impl Future<Output = Result<Result<Version>, RpcError>> + '_

Returns the daemon’s version.

Source

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.

Source

pub fn get_key_bundle( &self, ctx: Context, ) -> impl Future<Output = Result<Result<KeyBundle>, RpcError>> + '_

Gets the public key bundle for this device

Source

pub fn get_device_id( &self, ctx: Context, ) -> impl Future<Output = Result<Result<DeviceId>, RpcError>> + '_

Gets the public device id.

Source

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.

Source

pub fn sync_now( &self, ctx: Context, addr: Addr, team: TeamId, cfg: Option<SyncPeerConfig>, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_

Sync with peer immediately.

Source

pub fn remove_sync_peer( &self, ctx: Context, addr: Addr, team: TeamId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_

Removes the peer from automatic syncing.

Source

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.

Source

pub fn remove_team( &self, ctx: Context, team: TeamId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_

Remove a team from local device storage.

Source

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.

Source

pub fn close_team( &self, ctx: Context, team: TeamId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_

Close the team.

Source

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.

Source

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.

Source

pub fn remove_device_from_team( &self, ctx: Context, team: TeamId, device: DeviceId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_

Remove device from the team.

Source

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.

Source

pub fn device_keybundle( &self, ctx: Context, team: TeamId, device: DeviceId, ) -> impl Future<Output = Result<Result<KeyBundle>, RpcError>> + '_

Returns the device’s key bundle.

Source

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.

Source

pub fn team_roles( &self, ctx: Context, team: TeamId, ) -> impl Future<Output = Result<Result<Box<[Role]>>, RpcError>> + '_

Returns the current team roles.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn delete_label( &self, ctx: Context, team: TeamId, label_id: LabelId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_

Delete a label.

Source

pub fn label( &self, ctx: Context, team: TeamId, label: LabelId, ) -> impl Future<Output = Result<Result<Option<Label>>, RpcError>> + '_

Returns a specific label.

Source

pub fn labels( &self, ctx: Context, team: TeamId, ) -> impl Future<Output = Result<Result<Vec<Label>>, RpcError>> + '_

Returns all labels on the team.

Source

pub fn add_label_managing_role( &self, ctx: Context, team: TeamId, label_id: LabelId, managing_role_id: RoleId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_

Source

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.

Source

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.

Source

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.

Source

pub fn afc_shm_info( &self, ctx: Context, ) -> impl Future<Output = Result<Result<AfcShmInfo>, RpcError>> + '_

Available on crate feature afc only.

Gets AFC shared-memory configuration info.

Source

pub 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.

Create a send-only AFC channel.

Source

pub fn delete_afc_channel( &self, ctx: Context, chan: AfcLocalChannelId, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_

Available on crate feature afc only.

Delete a AFC channel.

Source

pub fn accept_afc_channel( &self, ctx: Context, team: TeamId, ctrl: AfcCtrl, ) -> impl Future<Output = Result<Result<AfcReceiveChannelInfo>, RpcError>> + '_

Available on crate feature 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>

Source§

fn clone(&self) -> DaemonApiClient<Stub>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Stub: Debug> Debug for DaemonApiClient<Stub>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Stub> From<Stub> for DaemonApiClient<Stub>
where Stub: Stub<Req = DaemonApiRequest, Resp = DaemonApiResponse>,

Source§

fn from(stub: Stub) -> Self

Returns a new client stub that sends requests over the given transport.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> Upcast<T> for U
where T: UpcastFrom<U>,

Source§

fn upcast(self) -> T

Source§

impl<T, B> UpcastFrom<Counter<T, B>> for T

Source§

fn upcast_from(value: Counter<T, B>) -> T

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more