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<SocketAddr>, 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>> + '_

Source

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

Add device to the team.

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 assign_role( &self, ctx: Context, team: TeamId, device: DeviceId, role: Role, ) -> 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: Role, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_

Revoke a role from a device.

Source

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

Source

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

Source

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

Source

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

Source

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

Query devices on team.

Source

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

Query device role.

Source

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

Query device keybundle.

Source

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

Query device label assignments.

Source

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

Source

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

Query whether a label exists.

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