Skip to main content

LineageHandle

Struct LineageHandle 

Source
pub struct LineageHandle(/* private fields */);
Expand description

dioring’s handle to a live lineage (DI-D-40): what pushing into the lineage and sealing it take. Cloning it is cheap, and every copy names the same lineage.

Releasing the last copy ends the lineage (DI-D-30): every epoch of it not yet durable is abandoned, and a LineageEnded entry reports it. #[must_use] warns when a returned handle is discarded unused, but not for let _ = ..., which releases it at once, nor for a handle dropped with whatever held it – so keep a copy for as long as the lineage’s work matters. The default lineage never ends this way: the instance holds a copy of its own.

Implementations§

Source§

impl LineageHandle

Source

pub fn mint(lineage: Lineage, home: Weak<dyn Home>) -> LineageHandle

A handle to lineage, whose last release ends it through home.

Source

pub fn detached(lineage: Lineage) -> LineageHandle

A handle to lineage that ends nothing when released: for a lineage whose instance keeps nothing to end, such as a fake’s one lineage.

Source

pub fn lineage(&self) -> Lineage

The lineage, by its Copy name: what entries, reports and a consumer’s own records use.

Source

pub fn at<E, I>(&self, id: E) -> Tag<'_, DioringIds<E, I>>
where E: EpochId + 'static, I: Instant,

Epoch id of this lineage, as a write or a seal takes it.

Source

pub fn is_homed_at<T>(&self, home: &Arc<T>) -> bool
where T: ?Sized,

Whether this handle reports its release to home. The lineage a handle names and its instance are inputs to mint and detached, so they prove nothing about where the handle came from; the home does, because a caller holding no reference to the instance’s own cannot name it.

Source

pub fn is_last(&self) -> bool

Whether this is the lineage’s only remaining copy.

Source

pub fn take_last(self) -> Result<Lineage, LineageHandle>

Consume the lineage’s last handle without ending the lineage through it, because the caller is ending or retiring it explicitly. Hands the handle back if another copy exists.

Trait Implementations§

Source§

impl Clone for LineageHandle

Source§

fn clone(&self) -> LineageHandle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LineageHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.