pub struct Client { /* private fields */ }Expand description
Client for interacting with the IC Object Store canister.
Handles communication with the canister and optional AES-256 encryption.
§Fields
agent: IC agent for making calls to the canistercanister: Principal of the target canistercipher: Optional AES-256-GCM cipher for encryption/decryption
Implementations§
Trait Implementations§
Source§impl CanisterCaller for Client
impl CanisterCaller for Client
Source§async fn canister_query<In: ArgumentEncoder + Send, Out: CandidType + for<'a> Deserialize<'a>>(
&self,
canister: &Principal,
method: &str,
args: In,
) -> Result<Out, BoxError>
async fn canister_query<In: ArgumentEncoder + Send, Out: CandidType + for<'a> Deserialize<'a>>( &self, canister: &Principal, method: &str, args: In, ) -> Result<Out, BoxError>
Performs a query call to a canister (read-only, no state changes) Read more
Source§async fn canister_update<In: ArgumentEncoder + Send, Out: CandidType + for<'a> Deserialize<'a>>(
&self,
canister: &Principal,
method: &str,
args: In,
) -> Result<Out, BoxError>
async fn canister_update<In: ArgumentEncoder + Send, Out: CandidType + for<'a> Deserialize<'a>>( &self, canister: &Principal, method: &str, args: In, ) -> Result<Out, BoxError>
Performs an update call to a canister (may modify state) Read more
Source§impl ObjectStoreSDK for Client
impl ObjectStoreSDK for Client
fn canister(&self) -> &Principal
fn cipher(&self) -> Option<Arc<Aes256Gcm>>
Source§fn get_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<StateInfo, String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn get_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<StateInfo, String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Retrieves the current state of the object store
fn is_member<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
member_kind: &'life1 str,
user: &'life2 Principal,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn admin_add_managers<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 BTreeSet<Principal>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn admin_add_managers<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 BTreeSet<Principal>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Adds managers to the canister (requires controller privileges)
Source§fn admin_remove_managers<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 BTreeSet<Principal>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn admin_remove_managers<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 BTreeSet<Principal>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes managers from the canister (requires controller privileges)
Source§fn admin_add_auditors<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 BTreeSet<Principal>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn admin_add_auditors<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 BTreeSet<Principal>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Adds auditors to the canister (requires controller privileges)
Source§fn admin_remove_auditors<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 BTreeSet<Principal>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn admin_remove_auditors<'life0, 'life1, 'async_trait>(
&'life0 self,
args: &'life1 BTreeSet<Principal>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes auditors from the canister (requires controller privileges)
Source§fn put_opts<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 Path,
payload: &'life2 Bytes,
opts: PutOptions,
) -> Pin<Box<dyn Future<Output = Result<PutResult>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_opts<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 Path,
payload: &'life2 Bytes,
opts: PutOptions,
) -> Pin<Box<dyn Future<Output = Result<PutResult>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Stores data at specified path with options
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes data at specified path
Source§fn copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Path,
to: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn copy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Path,
to: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Copies data from one path to another
Source§fn copy_if_not_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Path,
to: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn copy_if_not_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Path,
to: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Copies data only if destination doesn’t exist
Source§fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Path,
to: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rename<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Path,
to: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Renames/moves data from one path to another
Source§fn rename_if_not_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Path,
to: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn rename_if_not_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Path,
to: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Renames/moves data only if destination doesn’t exist
Source§fn create_multipart<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<MultipartId>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_multipart<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<MultipartId>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Initiates a multipart upload
Source§fn put_part<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 Path,
id: &'life2 MultipartId,
part_idx: u64,
payload: &'life3 Bytes,
) -> Pin<Box<dyn Future<Output = Result<PartId>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn put_part<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 Path,
id: &'life2 MultipartId,
part_idx: u64,
payload: &'life3 Bytes,
) -> Pin<Box<dyn Future<Output = Result<PartId>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Uploads a part in a multipart upload
Source§fn complete_multipart<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 Path,
id: &'life2 MultipartId,
opts: &'life3 PutMultipartOptions,
) -> Pin<Box<dyn Future<Output = Result<PutResult>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn complete_multipart<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
path: &'life1 Path,
id: &'life2 MultipartId,
opts: &'life3 PutMultipartOptions,
) -> Pin<Box<dyn Future<Output = Result<PutResult>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Completes a multipart upload
Source§fn abort_multipart<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 Path,
id: &'life2 MultipartId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn abort_multipart<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 Path,
id: &'life2 MultipartId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Aborts a multipart upload
Source§fn get_part<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
part_idx: u64,
) -> Pin<Box<dyn Future<Output = Result<ByteBuf>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_part<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
part_idx: u64,
) -> Pin<Box<dyn Future<Output = Result<ByteBuf>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves a specific part of data
Source§fn get_opts<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
opts: GetOptions,
) -> Pin<Box<dyn Future<Output = Result<GetResult>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_opts<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
opts: GetOptions,
) -> Pin<Box<dyn Future<Output = Result<GetResult>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves data with options (range, if_match, etc.)
Source§fn get_ranges<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 Path,
ranges: &'life2 [(u64, u64)],
) -> Pin<Box<dyn Future<Output = Result<Vec<ByteBuf>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_ranges<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 Path,
ranges: &'life2 [(u64, u64)],
) -> Pin<Box<dyn Future<Output = Result<Vec<ByteBuf>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves multiple ranges of data
Source§fn head<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<ObjectMeta>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn head<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<ObjectMeta>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves metadata for a path
Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 Path>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectMeta>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 Path>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectMeta>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Lists objects under a prefix
Source§fn list_with_offset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 Path>,
offset: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectMeta>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_with_offset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 Path>,
offset: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectMeta>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Lists objects with an offset
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
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