pub struct Blob { /* private fields */ }
Expand description
A testing server implementation of an open /blob/
Blob does not send the OnOpen event or handle requests until instructed to do so.
Implementations§
Source§impl Blob
impl Blob
Sourcepub fn fail_open_with_already_exists(self)
pub fn fail_open_with_already_exists(self)
Sourcepub fn fail_open_with_not_found(self)
pub fn fail_open_with_not_found(self)
Sourcepub fn fail_open_with_io_error(self)
pub fn fail_open_with_io_error(self)
Sourcepub async fn fail_open_with_not_readable(self)
pub async fn fail_open_with_not_readable(self)
Succeeds the open request, but indicate the blob is not yet readable by not asserting the USER_0 signal on the file event handle, then asserts that the connection to the blob is closed.
§Panics
Panics on error
Sourcepub async fn succeed_open_with_blob_readable(self)
pub async fn succeed_open_with_blob_readable(self)
Succeeds the open request, indicating that the blob is readable, then asserts that the connection to the blob is closed.
§Panics
Panics on error
Sourcepub async fn expect_close(self)
pub async fn expect_close(self)
Succeeds the open request, then verifies the blob is immediately closed (possibly after handling a single Close request).
§Panics
Panics on error
Sourcepub async fn expect_done(self)
pub async fn expect_done(self)
Sourcepub async fn expect_read(self, blob: &[u8])
pub async fn expect_read(self, blob: &[u8])
Succeeds the open request, then handle read request with the given blob data.
§Panics
Panics on error
Sourcepub async fn serve_contents(self, data: &[u8])
pub async fn serve_contents(self, data: &[u8])
Succeeds the open request. Then handles get_attr, read, read_at, and possibly a final close requests with the given blob data.
§Panics
Panics on error
Sourcepub async fn fail_write_with_corrupt(self)
pub async fn fail_write_with_corrupt(self)
Succeeds the open request, consumes the truncate request, the initial write calls, then fails the final write indicating the written data was corrupt.
§Panics
Panics on error
Auto Trait Implementations§
impl Freeze for Blob
impl !RefUnwindSafe for Blob
impl Send for Blob
impl Sync for Blob
impl Unpin for Blob
impl !UnwindSafe for Blob
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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