Skip to main content

HeldVersion

Struct HeldVersion 

Source
pub struct HeldVersion { /* private fields */ }
Expand description

One task’s write held to the version its caller read.

Implementations§

Source§

impl HeldVersion

Source

pub fn new(id: NativeId, version: String) -> Self

A write of the task id held to version.

Source

pub async fn scope<F: Future>(held: Arc<Self>, call: F) -> F::Output

Run call with this hold answering every HeldVersion::expected made inside it.

Source

pub fn expected(id: &NativeId) -> Option<String>

The version the write in progress holds the task id to — None when no write in progress is held, or the one that is holds another task.

Source

pub fn moved(id: &NativeId, found: Option<String>) -> SourceError

Refuse the write in progress of the task id, which the source found at found rather than at the version it is held to: the refusal the source fails its call with, writing nothing, recorded so the engine reports it as the version having moved.

Source

pub fn found(&self) -> Option<String>

The version the source found the task at when it refused the write, if it did.

Source

pub const fn id(&self) -> &NativeId

The task this hold is for.

Source

pub fn version(&self) -> &str

The version the write is held to.

Trait Implementations§

Source§

impl Debug for HeldVersion

Source§

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

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.