pub trait HostContainer: Sized + Send {
// Required methods
fn name(
&mut self,
self_: Resource<Container>,
) -> impl Future<Output = Result<Result<String, Error>>> + Send;
fn info(
&mut self,
self_: Resource<Container>,
) -> impl Future<Output = Result<Result<ContainerMetadata, Error>>> + Send;
fn get_data(
&mut self,
self_: Resource<Container>,
name: ObjectName,
start: u64,
end: u64,
) -> impl Future<Output = Result<Result<Resource<IncomingValue>, Error>>> + Send;
fn write_data(
&mut self,
self_: Resource<Container>,
name: ObjectName,
data: Resource<OutgoingValue>,
) -> impl Future<Output = Result<Result<(), Error>>> + Send;
fn list_objects(
&mut self,
self_: Resource<Container>,
) -> impl Future<Output = Result<Result<Resource<StreamObjectNames>, Error>>> + Send;
fn delete_object(
&mut self,
self_: Resource<Container>,
name: ObjectName,
) -> impl Future<Output = Result<Result<(), Error>>> + Send;
fn delete_objects(
&mut self,
self_: Resource<Container>,
names: Vec<ObjectName>,
) -> impl Future<Output = Result<Result<(), Error>>> + Send;
fn has_object(
&mut self,
self_: Resource<Container>,
name: ObjectName,
) -> impl Future<Output = Result<Result<bool, Error>>> + Send;
fn object_info(
&mut self,
self_: Resource<Container>,
name: ObjectName,
) -> impl Future<Output = Result<Result<ObjectMetadata, Error>>> + Send;
fn clear(
&mut self,
self_: Resource<Container>,
) -> impl Future<Output = Result<Result<(), Error>>> + Send;
fn drop(
&mut self,
rep: Resource<Container>,
) -> impl Future<Output = Result<()>> + Send;
}
Required Methods§
Sourcefn name(
&mut self,
self_: Resource<Container>,
) -> impl Future<Output = Result<Result<String, Error>>> + Send
fn name( &mut self, self_: Resource<Container>, ) -> impl Future<Output = Result<Result<String, Error>>> + Send
returns container name
Sourcefn info(
&mut self,
self_: Resource<Container>,
) -> impl Future<Output = Result<Result<ContainerMetadata, Error>>> + Send
fn info( &mut self, self_: Resource<Container>, ) -> impl Future<Output = Result<Result<ContainerMetadata, Error>>> + Send
returns container metadata
Sourcefn get_data(
&mut self,
self_: Resource<Container>,
name: ObjectName,
start: u64,
end: u64,
) -> impl Future<Output = Result<Result<Resource<IncomingValue>, Error>>> + Send
fn get_data( &mut self, self_: Resource<Container>, name: ObjectName, start: u64, end: u64, ) -> impl Future<Output = Result<Result<Resource<IncomingValue>, Error>>> + Send
retrieves an object or portion of an object, as a resource. Start and end offsets are inclusive. Once a data-blob resource has been created, the underlying bytes are held by the blobstore service for the lifetime of the data-blob resource, even if the object they came from is later deleted.
Sourcefn write_data(
&mut self,
self_: Resource<Container>,
name: ObjectName,
data: Resource<OutgoingValue>,
) -> impl Future<Output = Result<Result<(), Error>>> + Send
fn write_data( &mut self, self_: Resource<Container>, name: ObjectName, data: Resource<OutgoingValue>, ) -> impl Future<Output = Result<Result<(), Error>>> + Send
creates or replaces an object with the data blob.
Sourcefn list_objects(
&mut self,
self_: Resource<Container>,
) -> impl Future<Output = Result<Result<Resource<StreamObjectNames>, Error>>> + Send
fn list_objects( &mut self, self_: Resource<Container>, ) -> impl Future<Output = Result<Result<Resource<StreamObjectNames>, Error>>> + Send
returns list of objects in the container. Order is undefined.
Sourcefn delete_object(
&mut self,
self_: Resource<Container>,
name: ObjectName,
) -> impl Future<Output = Result<Result<(), Error>>> + Send
fn delete_object( &mut self, self_: Resource<Container>, name: ObjectName, ) -> impl Future<Output = Result<Result<(), Error>>> + Send
deletes object. does not return error if object did not exist.
Sourcefn delete_objects(
&mut self,
self_: Resource<Container>,
names: Vec<ObjectName>,
) -> impl Future<Output = Result<Result<(), Error>>> + Send
fn delete_objects( &mut self, self_: Resource<Container>, names: Vec<ObjectName>, ) -> impl Future<Output = Result<Result<(), Error>>> + Send
deletes multiple objects in the container
Sourcefn has_object(
&mut self,
self_: Resource<Container>,
name: ObjectName,
) -> impl Future<Output = Result<Result<bool, Error>>> + Send
fn has_object( &mut self, self_: Resource<Container>, name: ObjectName, ) -> impl Future<Output = Result<Result<bool, Error>>> + Send
returns true if the object exists in this container
Sourcefn object_info(
&mut self,
self_: Resource<Container>,
name: ObjectName,
) -> impl Future<Output = Result<Result<ObjectMetadata, Error>>> + Send
fn object_info( &mut self, self_: Resource<Container>, name: ObjectName, ) -> impl Future<Output = Result<Result<ObjectMetadata, Error>>> + Send
returns metadata for the object
Sourcefn clear(
&mut self,
self_: Resource<Container>,
) -> impl Future<Output = Result<Result<(), Error>>> + Send
fn clear( &mut self, self_: Resource<Container>, ) -> impl Future<Output = Result<Result<(), Error>>> + Send
removes all objects within the container, leaving the container empty.
fn drop( &mut self, rep: Resource<Container>, ) -> impl Future<Output = Result<()>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<_T: HostContainer + ?Sized + Send> HostContainer for &mut _T
impl<_T: HostContainer + ?Sized + Send> HostContainer for &mut _T
Source§async fn name(
&mut self,
self_: Resource<Container>,
) -> Result<Result<String, Error>>
async fn name( &mut self, self_: Resource<Container>, ) -> Result<Result<String, Error>>
returns container name
Source§async fn info(
&mut self,
self_: Resource<Container>,
) -> Result<Result<ContainerMetadata, Error>>
async fn info( &mut self, self_: Resource<Container>, ) -> Result<Result<ContainerMetadata, Error>>
returns container metadata
Source§async fn get_data(
&mut self,
self_: Resource<Container>,
name: ObjectName,
start: u64,
end: u64,
) -> Result<Result<Resource<IncomingValue>, Error>>
async fn get_data( &mut self, self_: Resource<Container>, name: ObjectName, start: u64, end: u64, ) -> Result<Result<Resource<IncomingValue>, Error>>
retrieves an object or portion of an object, as a resource. Start and end offsets are inclusive. Once a data-blob resource has been created, the underlying bytes are held by the blobstore service for the lifetime of the data-blob resource, even if the object they came from is later deleted.
Source§async fn write_data(
&mut self,
self_: Resource<Container>,
name: ObjectName,
data: Resource<OutgoingValue>,
) -> Result<Result<(), Error>>
async fn write_data( &mut self, self_: Resource<Container>, name: ObjectName, data: Resource<OutgoingValue>, ) -> Result<Result<(), Error>>
creates or replaces an object with the data blob.
Source§async fn list_objects(
&mut self,
self_: Resource<Container>,
) -> Result<Result<Resource<StreamObjectNames>, Error>>
async fn list_objects( &mut self, self_: Resource<Container>, ) -> Result<Result<Resource<StreamObjectNames>, Error>>
returns list of objects in the container. Order is undefined.
Source§async fn delete_object(
&mut self,
self_: Resource<Container>,
name: ObjectName,
) -> Result<Result<(), Error>>
async fn delete_object( &mut self, self_: Resource<Container>, name: ObjectName, ) -> Result<Result<(), Error>>
deletes object. does not return error if object did not exist.
Source§async fn delete_objects(
&mut self,
self_: Resource<Container>,
names: Vec<ObjectName>,
) -> Result<Result<(), Error>>
async fn delete_objects( &mut self, self_: Resource<Container>, names: Vec<ObjectName>, ) -> Result<Result<(), Error>>
deletes multiple objects in the container
Source§async fn has_object(
&mut self,
self_: Resource<Container>,
name: ObjectName,
) -> Result<Result<bool, Error>>
async fn has_object( &mut self, self_: Resource<Container>, name: ObjectName, ) -> Result<Result<bool, Error>>
returns true if the object exists in this container
Source§async fn object_info(
&mut self,
self_: Resource<Container>,
name: ObjectName,
) -> Result<Result<ObjectMetadata, Error>>
async fn object_info( &mut self, self_: Resource<Container>, name: ObjectName, ) -> Result<Result<ObjectMetadata, Error>>
returns metadata for the object
Source§async fn clear(
&mut self,
self_: Resource<Container>,
) -> Result<Result<(), Error>>
async fn clear( &mut self, self_: Resource<Container>, ) -> Result<Result<(), Error>>
removes all objects within the container, leaving the container empty.