Struct cloud_storage_lite::client::MockBucketClient[][src]

pub struct MockBucketClient { /* fields omitted */ }

A GCS client that targets a specific bucket.

Implementations

impl MockBucketClient[src]

pub fn checkpoint(&mut self)[src]

Validate that all current expectations for all methods have been satisfied, and discard them.

pub fn new() -> Self[src]

Create a new mock object with no expectations.

This method will not be generated if the real struct already has a new method. However, it will be generated if the struct implements a trait with a new method. The trait’s new method can still be called like <MockX as TraitY>::new

impl MockBucketClient[src]

#[must_use = "Must set return value when not using the \"nightly\" feature"]pub fn expect_bucket_name(&mut self) -> &mut Expectation[src]

Create an Expectation for mocking the bucket_name method

#[must_use = "Must set return value when not using the \"nightly\" feature"]pub fn expect_ping(&mut self) -> &mut Expectation[src]

Create an Expectation for mocking the ping method

#[must_use = "Must set return value when not using the \"nightly\" feature"]pub fn expect_list_objects(&mut self) -> &mut Expectation[src]

Create an Expectation for mocking the list_objects method

#[must_use = "Must set return value when not using the \"nightly\" feature"]pub fn expect_create_object<S>(&mut self) -> &mut Expectation<S> where
    S: TryStream + Send + Sync + 'static,
    S::Error: Into<Box<dyn Error + Send + Sync>>,
    Bytes: From<S::Ok>, 
[src]

Create an Expectation for mocking the create_object method

#[must_use = "Must set return value when not using the \"nightly\" feature"]pub fn expect_get_object(&mut self) -> &mut Expectation[src]

Create an Expectation for mocking the get_object method

#[must_use = "Must set return value when not using the \"nightly\" feature"]pub fn expect_download_object(&mut self) -> &mut Expectation[src]

Create an Expectation for mocking the download_object method

#[must_use = "Must set return value when not using the \"nightly\" feature"]pub fn expect_delete_object(&mut self) -> &mut Expectation[src]

Create an Expectation for mocking the delete_object method

Trait Implementations

impl BucketClient for MockBucketClient[src]

A GCS client that targets a specific bucket.

fn bucket_name(&self) -> &str[src]

Returns the name of the bucket to which this BucketClient is connected.

fn ping<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Checks connectivity to the bucket.

fn list_objects<'a, 'life0, 'async_trait>(
    &'life0 self,
    options: ListObjectOptions<'a>
) -> Pin<Box<dyn Future<Output = Result<Page<Object>, Error>> + Send + 'async_trait>> where
    'a: 'async_trait,
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Returns a page of objects.

fn create_object<'life0, 'life1, 'async_trait, S>(
    &'life0 self,
    key: &'life1 str,
    value: S
) -> Pin<Box<dyn Future<Output = Result<Object, Error>> + Send + 'async_trait>> where
    S: TryStream + Send + Sync + 'static,
    S::Error: Into<Box<dyn Error + Send + Sync>>,
    Bytes: From<S::Ok>,
    S: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Creates a new object.

fn get_object<'life0, 'life1, 'async_trait>(
    &'life0 self,
    key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Object, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Gets an object’s metadata.

fn download_object<'life0, 'life1, 'async_trait>(
    &'life0 self,
    key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<Bytes, Error>>, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Downloads an object.

fn delete_object<'life0, 'life1, 'async_trait>(
    &'life0 self,
    key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Deletes an object. This library does not consider deleting a non-existent object an error.

impl Default for MockBucketClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.