aranya_daemon_api

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 initialize( &self, ctx: Context, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_

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, interval: Duration, ) -> impl Future<Output = Result<Result<()>, RpcError>> + '_

Adds the peer for automatic periodic syncing.

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, team: TeamId, ) -> 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 the local device store.

source

pub fn create_team( &self, ctx: Context, ) -> 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>> + '_

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn create_channel( &self, ctx: Context, team: TeamId, peer: NetIdentifier, label: Label, ) -> impl Future<Output = Result<Result<(ChannelId, NodeId, AfcCtrl)>, RpcError>> + '_

source

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

source

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

Trait Implementations§

source§

impl<Stub: Clone> Clone for DaemonApiClient<Stub>

source§

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

Returns a copy 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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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<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