pub struct TestDeliveryHandler<F>(pub F);Expand description
A DeliveryHandler test adapter that implements get_page_request via a closure.
The closure takes (key: u64, range: Range<u64>) where:
key: The pager port key identifying the mapped file.range: The byte range requested to be paged in.
And returns R: PageRequest (any type implementing PageRequest) to receive the paged data.
DeliveryHandler::register_blob defaults to a no-op Ok(()).
Tuple Fields§
§0: FTrait Implementations§
Source§impl<F, R: PageRequest> DeliveryHandler for TestDeliveryHandler<F>
impl<F, R: PageRequest> DeliveryHandler for TestDeliveryHandler<F>
type Request = R
Source§fn get_page_request(
self: &Arc<Self>,
key: u64,
range: Range<u64>,
) -> Self::Request
fn get_page_request( self: &Arc<Self>, key: u64, range: Range<u64>, ) -> Self::Request
Produces a
PageRequest to receive decompressed or uncompressed page data.Source§fn register_blob(
&self,
_key: u64,
_merkle_leaves: &[[u8; 32]],
) -> Result<(), Error>
fn register_blob( &self, _key: u64, _merkle_leaves: &[[u8; 32]], ) -> Result<(), Error>
Registers a blob’s Merkle tree leaf hashes with the downstream verifier.
Source§fn unregister_file(&self, _key: u64)
fn unregister_file(&self, _key: u64)
Unregisters a file when it is closed.
Auto Trait Implementations§
impl<F> Freeze for TestDeliveryHandler<F>where
F: Freeze,
impl<F> RefUnwindSafe for TestDeliveryHandler<F>where
F: RefUnwindSafe,
impl<F> Send for TestDeliveryHandler<F>where
F: Send,
impl<F> Sync for TestDeliveryHandler<F>where
F: Sync,
impl<F> Unpin for TestDeliveryHandler<F>where
F: Unpin,
impl<F> UnsafeUnpin for TestDeliveryHandler<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for TestDeliveryHandler<F>where
F: UnwindSafe,
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
Mutably borrows from an owned value. Read more
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§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> ⓘ
Converts
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> ⓘ
Converts
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