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
Sourcepub async fn connect_channel(
config: &AnytypeGrpcConfig,
) -> Result<Channel, AnytypeGrpcError>
pub async fn connect_channel( config: &AnytypeGrpcConfig, ) -> Result<Channel, AnytypeGrpcError>
Connects the raw transport after validating the configured timeout policy.
This method only establishes the transport. Construct an
AnytypeGrpcClient to apply logical deadlines to generated RPCs.
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>
Sourcepub fn client_commands(&self) -> ClientCommandsClient<AnytypeGrpcService>
pub fn client_commands(&self) -> ClientCommandsClient<AnytypeGrpcService>
Returns generated commands over the configured deadline-aware service.
Requests without explicit GrpcCallOptions
use the ordinary unary profile. Existing shorter grpc-timeout
metadata remains authoritative.
pub fn token(&self) -> &str
Sourcepub fn channel(&self) -> Channel
pub fn channel(&self) -> Channel
Returns the raw transport channel for compatibility with channel-generic helpers.
Calls made directly through this channel do not receive the logical
deadline policy. Prefer Self::client_commands for generated RPCs.
Sourcepub fn deadline_channel(&self) -> AnytypeGrpcService
pub fn deadline_channel(&self) -> AnytypeGrpcService
Returns a cloned deadline-aware tonic service.
Sourcepub const fn grpc_timeouts(&self) -> GrpcTimeoutPolicy
pub const fn grpc_timeouts(&self) -> GrpcTimeoutPolicy
Returns the resolved logical gRPC deadline policy.
Trait Implementations§
Source§impl Clone for AnytypeGrpcClient
impl Clone for AnytypeGrpcClient
Source§fn clone(&self) -> AnytypeGrpcClient
fn clone(&self) -> AnytypeGrpcClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AnytypeGrpcClient
impl !UnwindSafe for AnytypeGrpcClient
impl Freeze for AnytypeGrpcClient
impl Send for AnytypeGrpcClient
impl Sync for AnytypeGrpcClient
impl Unpin for AnytypeGrpcClient
impl UnsafeUnpin 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
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>
T in a tonic::Request