pub struct AnytypeGrpcClient { /* private fields */ }Expand description
gRPC client wrapper holding the connection and session token.
Implementations§
Source§impl AnytypeGrpcClient
impl AnytypeGrpcClient
Sourcepub async fn backup_space(
&self,
options: SpaceBackupOptions,
) -> Result<SpaceBackupResult, BackupError>
pub async fn backup_space( &self, options: SpaceBackupOptions, ) -> Result<SpaceBackupResult, BackupError>
Exports a space backup using gRPC ObjectListExport and moves the server output to
a deterministic target name: <prefix>_<space-name>_<timestamp>.
Source§impl AnytypeGrpcClient
impl AnytypeGrpcClient
Sourcepub fn get_endpoint(&self) -> &str
pub fn get_endpoint(&self) -> &str
returns the endpoint
pub async fn connect_channel( config: &AnytypeGrpcConfig, ) -> Result<Channel, AnytypeGrpcError>
Sourcepub async fn from_account_key(
config: &AnytypeGrpcConfig,
account_key: impl AsRef<str>,
) -> Result<Self, AnytypeGrpcError>
pub async fn from_account_key( config: &AnytypeGrpcConfig, account_key: impl AsRef<str>, ) -> Result<Self, AnytypeGrpcError>
if you’re using the headless client, you can generate a session token from the account key in ~/.anytype/config.json
pub async fn from_app_key( config: &AnytypeGrpcConfig, app_key: impl AsRef<str>, ) -> Result<Self, AnytypeGrpcError>
pub async fn from_token( config: &AnytypeGrpcConfig, token: impl Into<String>, ) -> Result<Self, AnytypeGrpcError>
pub fn client_commands(&self) -> ClientCommandsClient<Channel>
pub fn token(&self) -> &str
pub fn channel(&self) -> Channel
Trait Implementations§
Source§impl Clone for AnytypeGrpcClient
impl Clone for AnytypeGrpcClient
Source§fn clone(&self) -> AnytypeGrpcClient
fn clone(&self) -> AnytypeGrpcClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AnytypeGrpcClient
impl !RefUnwindSafe for AnytypeGrpcClient
impl Send for AnytypeGrpcClient
impl Sync for AnytypeGrpcClient
impl Unpin for AnytypeGrpcClient
impl UnsafeUnpin for AnytypeGrpcClient
impl !UnwindSafe for AnytypeGrpcClient
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request