pub struct MockBlobEngine {
BlobEngine_expectations: MockBlobEngine_BlobEngine,
}Expand description
Trait describing an interface to open blobs for reading and writing.
Fields§
§BlobEngine_expectations: MockBlobEngine_BlobEngineImplementations§
Source§impl MockBlobEngine
impl MockBlobEngine
Sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Validate that all current expectations for all methods have been satisfied, and discard them.
Sourcepub fn new() -> Self
pub fn new() -> Self
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
Source§impl MockBlobEngine
impl MockBlobEngine
Sourcepub fn expect_has(&mut self) -> &mut Expectation
pub fn expect_has(&mut self) -> &mut Expectation
Create an Expectation for mocking the has method
Sourcepub fn expect_open_read(&mut self) -> &mut Expectation
pub fn expect_open_read(&mut self) -> &mut Expectation
Create an Expectation for mocking the open_read method
Sourcepub fn expect_open_write(&mut self) -> &mut Expectation<'static>
pub fn expect_open_write(&mut self) -> &mut Expectation<'static>
Create an Expectation for mocking the open_write method
Trait Implementations§
Source§impl BlobEngine for MockBlobEngine
Trait describing an interface to open blobs for reading and writing.
impl BlobEngine for MockBlobEngine
Trait describing an interface to open blobs for reading and writing.
Source§fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 B3Digest,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 B3Digest,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if the blob with this digest exists.
Source§fn open_read<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 B3Digest,
size_hint: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn Reader + 'static>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn open_read<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 B3Digest,
size_hint: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn Reader + 'static>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Request a blob from the store for reading. An optional size_hint can be specified, allowing some implementations to optimize.
Source§fn open_write<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Box<dyn Writer + 'a>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn open_write<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Box<dyn Writer + 'a>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Allows writing a new blob.
Returns a crate::blobstore::Writer, which
implements tokio::io::AsyncWrite and has a close method to finalize
the blob and get its digest.
Source§impl Debug for MockBlobEngine
impl Debug for MockBlobEngine
Auto Trait Implementations§
impl Freeze for MockBlobEngine
impl RefUnwindSafe for MockBlobEngine
impl Send for MockBlobEngine
impl Sync for MockBlobEngine
impl Unpin for MockBlobEngine
impl UnsafeUnpin for MockBlobEngine
impl UnwindSafe for MockBlobEngine
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
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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].