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