pub struct DeliveryHandle<D> { /* private fields */ }Expand description
The operations of an instance whose delivery an EntryDelivery owns, through &self from
any thread. The handler is given one; the owner derefs to its own, so both offer the same
operations from one definition.
Each call takes the front end’s lock on the instance for its duration – dioring’s lock in DI-D-18’s order, taken before the ring’s – and the handler is called with that lock released.
§What it withholds
popandreadiness: the delivery is the single deliverer and the signal’s one waiter (DI-D-28). A second popper would take entries out of order; a second waiter would steal wakes.- Any
&mutto the instance, including through a closure. Safe code could then replace the instance while the wait stayed armed on the old one’s signal, and delivery would stop without an error – the ring crate’s measured defect (D-43), which a closure does not close. Registered bytes are therefore reached through closures over the bytes alone.
Not constructible, and not Clone: a handler holds one only for the length of a call, so it
cannot keep the front end alive.
Implementations§
Source§impl<D: DurableRing> DeliveryHandle<D>
impl<D: DurableRing> DeliveryHandle<D>
Sourcepub fn add_target(
&self,
key: IoTargetKey,
target: D::Target,
) -> Result<(), AddTargetError<D::Target>>
pub fn add_target( &self, key: IoTargetKey, target: D::Target, ) -> Result<(), AddTargetError<D::Target>>
Sourcepub fn remove_target(
&self,
key: IoTargetKey,
) -> Result<D::Target, RemoveTargetError<D::Ids>>
pub fn remove_target( &self, key: IoTargetKey, ) -> Result<D::Target, RemoveTargetError<D::Ids>>
Sourcepub fn default_lineage(&self) -> HandleOf<D>
pub fn default_lineage(&self) -> HandleOf<D>
Sourcepub fn mint_lineage(&self, description: Option<String>) -> HandleOf<D>
pub fn mint_lineage(&self, description: Option<String>) -> HandleOf<D>
Sourcepub fn lineages(&self) -> Vec<LineageInfo<D::Ids>>
pub fn lineages(&self) -> Vec<LineageInfo<D::Ids>>
Sourcepub fn end_lineage(
&self,
handle: HandleOf<D>,
) -> Result<(), EndLineageError<D::Ids>>
pub fn end_lineage( &self, handle: HandleOf<D>, ) -> Result<(), EndLineageError<D::Ids>>
Sourcepub fn retire_lineage(
&self,
handle: HandleOf<D>,
) -> Result<(), RetireLineageError<D::Ids>>
pub fn retire_lineage( &self, handle: HandleOf<D>, ) -> Result<(), RetireLineageError<D::Ids>>
Sourcepub fn write(
&self,
file: IoTargetKey,
offset: u64,
buffer: D::Buffer,
tag: Tag<'_, D::Ids>,
context: D::Context,
) -> PushResult<D>
pub fn write( &self, file: IoTargetKey, offset: u64, buffer: D::Buffer, tag: Tag<'_, D::Ids>, context: D::Context, ) -> PushResult<D>
Sourcepub fn write_with(
&self,
file: IoTargetKey,
offset: u64,
buffer: D::Buffer,
tag: Tag<'_, D::Ids>,
context: D::Context,
options: WriteOptions<D::Ids>,
) -> PushResult<D>
pub fn write_with( &self, file: IoTargetKey, offset: u64, buffer: D::Buffer, tag: Tag<'_, D::Ids>, context: D::Context, options: WriteOptions<D::Ids>, ) -> PushResult<D>
Sourcepub fn read(
&self,
file: IoTargetKey,
offset: u64,
buffer: D::Buffer,
context: D::Context,
) -> PushResult<D>
pub fn read( &self, file: IoTargetKey, offset: u64, buffer: D::Buffer, context: D::Context, ) -> PushResult<D>
Sourcepub fn read_with(
&self,
file: IoTargetKey,
offset: u64,
buffer: D::Buffer,
context: D::Context,
options: ReadOptions<D::Ids>,
) -> PushResult<D>
pub fn read_with( &self, file: IoTargetKey, offset: u64, buffer: D::Buffer, context: D::Context, options: ReadOptions<D::Ids>, ) -> PushResult<D>
Sourcepub fn make_durable_through(
&self,
through: Tag<'_, D::Ids>,
) -> Result<DurabilityRequest<D::Ids>, SealError<D::Ids>>
pub fn make_durable_through( &self, through: Tag<'_, D::Ids>, ) -> Result<DurabilityRequest<D::Ids>, SealError<D::Ids>>
Sourcepub fn durable_through(
&self,
lineage: Lin<D>,
) -> Result<Option<EpochIdOf<D>>, UnknownLineage<D::Ids>>
pub fn durable_through( &self, lineage: Lin<D>, ) -> Result<Option<EpochIdOf<D>>, UnknownLineage<D::Ids>>
Sourcepub fn sealed_through(
&self,
lineage: Lin<D>,
) -> Result<Option<EpochIdOf<D>>, UnknownLineage<D::Ids>>
pub fn sealed_through( &self, lineage: Lin<D>, ) -> Result<Option<EpochIdOf<D>>, UnknownLineage<D::Ids>>
Sourcepub fn epoch_state(
&self,
epoch: Epoch<D::Ids>,
) -> Result<EpochState<D::Ids>, UnknownLineage<D::Ids>>
pub fn epoch_state( &self, epoch: Epoch<D::Ids>, ) -> Result<EpochState<D::Ids>, UnknownLineage<D::Ids>>
Sourcepub fn resolve(
&self,
items: Vec<(TokenOf<D>, Resolution)>,
) -> Result<(), ResolveError<D::Ids>>
pub fn resolve( &self, items: Vec<(TokenOf<D>, Resolution)>, ) -> Result<(), ResolveError<D::Ids>>
Sourcepub fn import_failure(
&self,
scope: ImportScope<D::Ids>,
) -> Result<Imported<D::Ids>, UnknownLineage<D::Ids>>
pub fn import_failure( &self, scope: ImportScope<D::Ids>, ) -> Result<Imported<D::Ids>, UnknownLineage<D::Ids>>
Sourcepub fn failures(&self) -> Vec<FailureInfo<D::Ids>>
pub fn failures(&self) -> Vec<FailureInfo<D::Ids>>
Sourcepub fn take_token(&self, failure: FailureIdOf<D>) -> Option<TokenOf<D>>
pub fn take_token(&self, failure: FailureIdOf<D>) -> Option<TokenOf<D>>
Source§impl<D: RegisteredBufferRing> DeliveryHandle<D>
impl<D: RegisteredBufferRing> DeliveryHandle<D>
Sourcepub fn with_registered_buffer<R>(
&self,
i: u32,
f: impl FnOnce(&[u8]) -> R,
) -> Result<R>
pub fn with_registered_buffer<R>( &self, i: u32, f: impl FnOnce(&[u8]) -> R, ) -> Result<R>
Run f on the bytes of registered buffer i, under the front end’s lock.
§Errors
Sourcepub fn with_registered_buffer_mut<R>(
&self,
i: u32,
f: impl FnOnce(&mut [u8]) -> R,
) -> Result<R>
pub fn with_registered_buffer_mut<R>( &self, i: u32, f: impl FnOnce(&mut [u8]) -> R, ) -> Result<R>
Run f on the bytes of registered buffer i, mutably, under the front end’s lock.
§Errors
Sourcepub fn write_registered(
&self,
file: IoTargetKey,
offset: u64,
span: RegisteredSpan,
tag: Tag<'_, D::Ids>,
context: D::Context,
) -> PushResult<D>
pub fn write_registered( &self, file: IoTargetKey, offset: u64, span: RegisteredSpan, tag: Tag<'_, D::Ids>, context: D::Context, ) -> PushResult<D>
Sourcepub fn write_registered_with(
&self,
file: IoTargetKey,
offset: u64,
span: RegisteredSpan,
tag: Tag<'_, D::Ids>,
context: D::Context,
options: WriteOptions<D::Ids>,
) -> PushResult<D>
pub fn write_registered_with( &self, file: IoTargetKey, offset: u64, span: RegisteredSpan, tag: Tag<'_, D::Ids>, context: D::Context, options: WriteOptions<D::Ids>, ) -> PushResult<D>
Sourcepub fn read_registered(
&self,
file: IoTargetKey,
offset: u64,
span: RegisteredSpan,
context: D::Context,
) -> PushResult<D>
pub fn read_registered( &self, file: IoTargetKey, offset: u64, span: RegisteredSpan, context: D::Context, ) -> PushResult<D>
Sourcepub fn read_registered_with(
&self,
file: IoTargetKey,
offset: u64,
span: RegisteredSpan,
context: D::Context,
options: ReadOptions<D::Ids>,
) -> PushResult<D>
pub fn read_registered_with( &self, file: IoTargetKey, offset: u64, span: RegisteredSpan, context: D::Context, options: ReadOptions<D::Ids>, ) -> PushResult<D>
Auto Trait Implementations§
impl<D> !Freeze for DeliveryHandle<D>
impl<D> RefUnwindSafe for DeliveryHandle<D>
impl<D> Send for DeliveryHandle<D>
impl<D> Sync for DeliveryHandle<D>
impl<D> Unpin for DeliveryHandle<D>
impl<D> UnsafeUnpin for DeliveryHandle<D>
impl<D> UnwindSafe for DeliveryHandle<D>
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