pub struct NeoFSClient { /* private fields */ }
Expand description
Client for interacting with NeoFS
Implementations§
Source§impl NeoFSClient
impl NeoFSClient
Sourcepub fn new(config: NeoFSConfig) -> Self
pub fn new(config: NeoFSConfig) -> Self
Creates a new NeoFS client with the given configuration
Sourcepub fn with_account(self, account: Account) -> Self
pub fn with_account(self, account: Account) -> Self
Sets the account to use for authentication
Sourcepub fn get_owner_id(&self) -> NeoFSResult<OwnerId>
pub fn get_owner_id(&self) -> NeoFSResult<OwnerId>
Gets the account’s owner ID
Sourcepub async fn init_multipart_upload(
&self,
container_id: &ContainerId,
object: &Object,
part_size: u64,
) -> NeoFSResult<MultipartUpload>
pub async fn init_multipart_upload( &self, container_id: &ContainerId, object: &Object, part_size: u64, ) -> NeoFSResult<MultipartUpload>
Initializes a multipart upload
Sourcepub async fn upload_part(
&self,
upload: &MultipartUpload,
part: Part,
) -> NeoFSResult<()>
pub async fn upload_part( &self, upload: &MultipartUpload, part: Part, ) -> NeoFSResult<()>
Uploads a part of a multipart upload
Sourcepub async fn complete_multipart_upload(
&self,
upload: &MultipartUpload,
part_numbers: Vec<u32>,
) -> NeoFSResult<MultipartUploadResult>
pub async fn complete_multipart_upload( &self, upload: &MultipartUpload, part_numbers: Vec<u32>, ) -> NeoFSResult<MultipartUploadResult>
Completes a multipart upload
Sourcepub async fn abort_multipart_upload(
&self,
upload: &MultipartUpload,
) -> NeoFSResult<()>
pub async fn abort_multipart_upload( &self, upload: &MultipartUpload, ) -> NeoFSResult<()>
Aborts a multipart upload
Trait Implementations§
Source§impl Clone for NeoFSClient
impl Clone for NeoFSClient
Source§fn clone(&self) -> NeoFSClient
fn clone(&self) -> NeoFSClient
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NeoFSClient
impl Debug for NeoFSClient
Source§impl NeoFSService for NeoFSClient
impl NeoFSService for NeoFSClient
Source§fn create_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container: &'life1 Container,
) -> Pin<Box<dyn Future<Output = NeoFSResult<ContainerId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_container<'life0, 'life1, 'async_trait>(
&'life0 self,
container: &'life1 Container,
) -> Pin<Box<dyn Future<Output = NeoFSResult<ContainerId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new container in NeoFS
Source§fn get_container<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ContainerId,
) -> Pin<Box<dyn Future<Output = NeoFSResult<Container>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_container<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ContainerId,
) -> Pin<Box<dyn Future<Output = NeoFSResult<Container>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets a container by its ID
Source§fn list_containers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = NeoFSResult<Vec<ContainerId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_containers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = NeoFSResult<Vec<ContainerId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists all containers owned by the current account
Source§fn delete_container<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ContainerId,
) -> Pin<Box<dyn Future<Output = NeoFSResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_container<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 ContainerId,
) -> Pin<Box<dyn Future<Output = NeoFSResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes a container by its ID
Source§fn put_object<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
object: &'life2 Object,
) -> Pin<Box<dyn Future<Output = NeoFSResult<ObjectId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_object<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
object: &'life2 Object,
) -> Pin<Box<dyn Future<Output = NeoFSResult<ObjectId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Uploads an object to a container
Source§fn get_object<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
object_id: &'life2 ObjectId,
) -> Pin<Box<dyn Future<Output = NeoFSResult<Object>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_object<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
object_id: &'life2 ObjectId,
) -> Pin<Box<dyn Future<Output = NeoFSResult<Object>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Gets an object by its ID from a container
Source§fn list_objects<'life0, 'life1, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
) -> Pin<Box<dyn Future<Output = NeoFSResult<Vec<ObjectId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_objects<'life0, 'life1, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
) -> Pin<Box<dyn Future<Output = NeoFSResult<Vec<ObjectId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Lists all objects in a container
Source§fn delete_object<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
object_id: &'life2 ObjectId,
) -> Pin<Box<dyn Future<Output = NeoFSResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_object<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
object_id: &'life2 ObjectId,
) -> Pin<Box<dyn Future<Output = NeoFSResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Deletes an object by its ID from a container
Source§fn create_bearer_token<'life0, 'life1, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
permissions: Vec<AccessPermission>,
expires_sec: u64,
) -> Pin<Box<dyn Future<Output = NeoFSResult<BearerToken>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_bearer_token<'life0, 'life1, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
permissions: Vec<AccessPermission>,
expires_sec: u64,
) -> Pin<Box<dyn Future<Output = NeoFSResult<BearerToken>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a bearer token for accessing objects in a container
Source§fn get_session_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = NeoFSResult<SessionToken>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_session_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = NeoFSResult<SessionToken>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets a session token for the current account
Source§fn initiate_multipart_upload<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
object: &'life2 Object,
) -> Pin<Box<dyn Future<Output = NeoFSResult<MultipartUpload>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn initiate_multipart_upload<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
container_id: &'life1 ContainerId,
object: &'life2 Object,
) -> Pin<Box<dyn Future<Output = NeoFSResult<MultipartUpload>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Initiates a multipart upload for a large object
Source§fn upload_part<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 MultipartUpload,
part_number: u32,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = NeoFSResult<Part>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn upload_part<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 MultipartUpload,
part_number: u32,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = NeoFSResult<Part>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Uploads a part of a multipart upload
Source§fn complete_multipart_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 MultipartUpload,
parts: Vec<Part>,
) -> Pin<Box<dyn Future<Output = NeoFSResult<MultipartUploadResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete_multipart_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 MultipartUpload,
parts: Vec<Part>,
) -> Pin<Box<dyn Future<Output = NeoFSResult<MultipartUploadResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Completes a multipart upload
Source§fn abort_multipart_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 MultipartUpload,
) -> Pin<Box<dyn Future<Output = NeoFSResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn abort_multipart_upload<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 MultipartUpload,
) -> Pin<Box<dyn Future<Output = NeoFSResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Aborts a multipart upload
Auto Trait Implementations§
impl Freeze for NeoFSClient
impl !RefUnwindSafe for NeoFSClient
impl Send for NeoFSClient
impl Sync for NeoFSClient
impl Unpin for NeoFSClient
impl !UnwindSafe for NeoFSClient
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more