Skip to main content

LinkedChainBuilder

Struct LinkedChainBuilder 

Source
pub struct LinkedChainBuilder<'ring> { /* private fields */ }
Expand description

Constructeur d’une chaîne d’opérations liées sur un IoUring en mode staging (cf. module). Emprunte le ring &mut pour toute sa durée (aucune soumission directe ne peut s’intercaler).

Implementations§

Source§

impl LinkedChainBuilder<'_>

Source

pub fn first<F>(self, op: F) -> Result<Self, Errno>
where F: FnOnce(&mut IoUring) -> Result<SubmissionToken, Errno>,

Premier maillon : op appelle un submit_* normal, mis en attente (staging). Ne pose aucun drapeau de lien (pas de prédécesseur).

§Errors

L’erreur du submit_* (ex. [Errno::EBUSY] si la SQ/le slab sont pleins) ; la chaîne est alors rembobinée.

Source

pub fn then<F>(self, op: F) -> Result<Self, Errno>
where F: FnOnce(&mut IoUring) -> Result<SubmissionToken, Errno>,

Maillon soft-lié au précédent (IOSQE_IO_LINK posé sur le précédent) : une erreur de complétion du précédent (-errno, short read inclus) rompt la chaîne (suivants -ECANCELED).

§Errors

Voir LinkedChainBuilder::first.

Source

pub fn then_hard<F>(self, op: F) -> Result<Self, Errno>
where F: FnOnce(&mut IoUring) -> Result<SubmissionToken, Errno>,

Maillon hard-lié au précédent (IOSQE_IO_HARDLINK posé sur le précédent) : une erreur de complétion du précédent n’interrompt pas la chaîne (l’ordre reste garanti).

§Errors

Voir LinkedChainBuilder::first.

Borne dans le temps le maillon précédent via un LINK_TIMEOUT (op 15) : si le timeout expire avant la fin du maillon, le maillon est annulé (-ECANCELED) et la chaîne rompue (le timeout complète) ; si le maillon finit avant, le timeout est annulé. Unique manière sûre d’émettre un LINK_TIMEOUT (émission isolée refusée, Temps 2c).

§Errors

[Errno::EINVAL] s’il n’y a aucun maillon à borner ; sinon l’erreur du staging (chaîne rembobinée).

Source

pub fn submit(self) -> Result<ChainTokens, Errno>

Publie la chaîne entière, atomiquement (un seul store-release + un io_uring_enter). Rend les jetons dans l’ordre de soumission.

§Errors

Les erreurs de IoUring::submit ([Errno::EINTR] remonté tel quel, etc.). La réservation des slots ayant déjà réussi au staging, l’atomicité de la chaîne est garantie en amont (jamais de chaîne partielle).

Auto Trait Implementations§

§

impl<'ring> Freeze for LinkedChainBuilder<'ring>

§

impl<'ring> !RefUnwindSafe for LinkedChainBuilder<'ring>

§

impl<'ring> Send for LinkedChainBuilder<'ring>

§

impl<'ring> !Sync for LinkedChainBuilder<'ring>

§

impl<'ring> Unpin for LinkedChainBuilder<'ring>

§

impl<'ring> UnsafeUnpin for LinkedChainBuilder<'ring>

§

impl<'ring> !UnwindSafe for LinkedChainBuilder<'ring>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.