Struct openvet_common::storage::StorageClient
source · pub struct StorageClient<Stub = Channel<StorageRequest, StorageResponse>>(/* private fields */);Expand description
The client stub that makes RPC calls to the server. All request methods return Futures.
Implementations§
source§impl StorageClient
impl StorageClient
sourcepub fn new<T>(
config: Config,
transport: T,
) -> NewClient<Self, RequestDispatch<StorageRequest, StorageResponse, T>>where
T: Transport<ClientMessage<StorageRequest>, Response<StorageResponse>>,
pub fn new<T>(
config: Config,
transport: T,
) -> NewClient<Self, RequestDispatch<StorageRequest, StorageResponse, T>>where
T: Transport<ClientMessage<StorageRequest>, Response<StorageResponse>>,
Returns a new client stub that sends requests over the given transport.
source§impl<Stub> StorageClient<Stub>where
Stub: Stub<Req = StorageRequest, Resp = StorageResponse>,
impl<Stub> StorageClient<Stub>where
Stub: Stub<Req = StorageRequest, Resp = StorageResponse>,
sourcepub fn ping(
&self,
ctx: Context,
message: String,
) -> impl Future<Output = Result<String, RpcError>> + '_
pub fn ping( &self, ctx: Context, message: String, ) -> impl Future<Output = Result<String, RpcError>> + '_
Ping message, should respond with the same message.
sourcepub fn version(
&self,
ctx: Context,
) -> impl Future<Output = Result<Version, RpcError>> + '_
pub fn version( &self, ctx: Context, ) -> impl Future<Output = Result<Version, RpcError>> + '_
Get version of storage server.
sourcepub fn crate_write(
&self,
ctx: Context,
name: CrateInfo,
) -> impl Future<Output = Result<(), RpcError>> + '_
pub fn crate_write( &self, ctx: Context, name: CrateInfo, ) -> impl Future<Output = Result<(), RpcError>> + '_
Create a crate, if it does not exist.
sourcepub fn crate_list(
&self,
ctx: Context,
) -> impl Future<Output = Result<BTreeSet<CrateName>, RpcError>> + '_
pub fn crate_list( &self, ctx: Context, ) -> impl Future<Output = Result<BTreeSet<CrateName>, RpcError>> + '_
Get list of crates
sourcepub fn crate_info(
&self,
ctx: Context,
krate: CrateName,
) -> impl Future<Output = Result<Option<CrateInfo>, RpcError>> + '_
pub fn crate_info( &self, ctx: Context, krate: CrateName, ) -> impl Future<Output = Result<Option<CrateInfo>, RpcError>> + '_
Get full crate info
sourcepub fn object_get(
&self,
ctx: Context,
hash: Checksum,
) -> impl Future<Output = Result<Option<Bytes>, RpcError>> + '_
pub fn object_get( &self, ctx: Context, hash: Checksum, ) -> impl Future<Output = Result<Option<Bytes>, RpcError>> + '_
Get an object
sourcepub fn object_exists(
&self,
ctx: Context,
hash: Checksum,
) -> impl Future<Output = Result<bool, RpcError>> + '_
pub fn object_exists( &self, ctx: Context, hash: Checksum, ) -> impl Future<Output = Result<bool, RpcError>> + '_
Check if an object exists
sourcepub fn object_write(
&self,
ctx: Context,
bytes: Bytes,
) -> impl Future<Output = Result<Checksum, RpcError>> + '_
pub fn object_write( &self, ctx: Context, bytes: Bytes, ) -> impl Future<Output = Result<Checksum, RpcError>> + '_
Write an object
sourcepub fn object_gc(
&self,
ctx: Context,
) -> impl Future<Output = Result<(), RpcError>> + '_
pub fn object_gc( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_
Run garbage collection over objects
sourcepub fn sources_missing(
&self,
ctx: Context,
limit: usize,
) -> impl Future<Output = Result<BTreeSet<CrateVersion>, RpcError>> + '_
pub fn sources_missing( &self, ctx: Context, limit: usize, ) -> impl Future<Output = Result<BTreeSet<CrateVersion>, RpcError>> + '_
List all crate-versions which are missing sources
pub fn crate_tree_write( &self, ctx: Context, krate: CrateVersion, root: Node, ) -> impl Future<Output = Result<(), RpcError>> + '_
Trait Implementations§
source§impl<Stub: Clone> Clone for StorageClient<Stub>
impl<Stub: Clone> Clone for StorageClient<Stub>
source§fn clone(&self) -> StorageClient<Stub>
fn clone(&self) -> StorageClient<Stub>
Returns a copy 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 moresource§impl<Stub: Debug> Debug for StorageClient<Stub>
impl<Stub: Debug> Debug for StorageClient<Stub>
source§impl<Stub> From<Stub> for StorageClient<Stub>where
Stub: Stub<Req = StorageRequest, Resp = StorageResponse>,
impl<Stub> From<Stub> for StorageClient<Stub>where
Stub: Stub<Req = StorageRequest, Resp = StorageResponse>,
Auto Trait Implementations§
impl<Stub> Freeze for StorageClient<Stub>where
Stub: Freeze,
impl<Stub> RefUnwindSafe for StorageClient<Stub>where
Stub: RefUnwindSafe,
impl<Stub> Send for StorageClient<Stub>where
Stub: Send,
impl<Stub> Sync for StorageClient<Stub>where
Stub: Sync,
impl<Stub> Unpin for StorageClient<Stub>where
Stub: Unpin,
impl<Stub> UnwindSafe for StorageClient<Stub>where
Stub: UnwindSafe,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)