Skip to main content

ProcessObject

Struct ProcessObject 

Source
pub struct ProcessObject<M = MCard, P = PCardDefinition> {
    pub carrier: M,
    pub carrier_handle: Option<String>,
    pub disposables: Arc<Mutex<DisposableList>>,
    pub pcard: Option<P>,
    pub created_at: u64,
    pub is_active: bool,
}
Expand description

An object in the Total Category Process (\int P). Represents the coupled pair (M, F) with thread-safe execution fiber state.

Fields§

§carrier: M

Immutable carrier MCard resting state.

§carrier_handle: Option<String>

Optional handle pointer (e.g. “assets:notes.txt”).

§disposables: Arc<Mutex<DisposableList>>

Thread-safe stack of reversible side-effects for zero residual state.

§pcard: Option<P>

Optional PCard definition governing execution rules.

§created_at: u64

Millisecond timestamp of process creation.

§is_active: bool

Whether the fiber is currently active.

Implementations§

Source§

impl<M> ProcessObject<M, PCardDefinition>

Source

pub fn new(carrier: M) -> Self

Constructs a new ProcessObject coupled with an empty disposable stack.

Source§

impl<M, P> ProcessObject<M, P>

Source

pub fn new_with_pcard(carrier: M, pcard: P) -> Self

Constructs a ProcessObject with an explicit PCard.

Source

pub fn with_handle(self, handle: impl Into<String>) -> Self

Binds an initial handle pointer.

Source

pub fn with_pcard(self, pcard: P) -> Self

Attaches an executable PCard definition.

Source

pub fn register_disposable<F>(&self, cleanup: F) -> Result<(), FibrationError>
where F: FnOnce() -> Result<(), String> + Send + 'static,

Registers a reversible cleanup callback onto the fiber’s LIFO stack.

Source

pub fn pending_disposers_count(&self) -> Result<usize, FibrationError>

Returns the number of registered disposers awaiting unwinding.

Source

pub fn unwind(&self) -> Result<(), FibrationError>

Unwinds all registered disposers in strict LIFO order.

Trait Implementations§

Source§

impl<M: Clone, P: Clone> Clone for ProcessObject<M, P>

Source§

fn clone(&self) -> Self

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<M: Send + Sync, P: Send + Sync> Fibration<M, P> for ProcessObject<M, P>

Source§

fn project(&self) -> &M

Projection functor \pi(M, F) = M. Maps an active process object to its immutable carrier MCard resting state.
Source§

fn carrier_handle(&self) -> Option<&str>

Returns the handle pointer for this process (if bound).
Source§

fn lift_mutation(&mut self, next_carrier: M) -> Result<(), FibrationError>

Executes the Cartesian lift of an MCard mutation f: M -> M’. Unwinds existing fiber disposables in strict LIFO order, then updates the carrier.
Source§

fn lift_handle_rebind( &mut self, new_handle: impl Into<String>, ) -> Result<(), FibrationError>

Executes Cartesian lift of an alpha-conversion / handle rebinding.

Auto Trait Implementations§

§

impl<M, P> Forget for ProcessObject<M, P>

§

impl<M, P> Freeze for ProcessObject<M, P>
where M: Freeze, Option<P>: Freeze,

§

impl<M, P> RefUnwindSafe for ProcessObject<M, P>

§

impl<M, P> Send for ProcessObject<M, P>
where M: Send, Option<P>: Send,

§

impl<M, P> Sync for ProcessObject<M, P>
where M: Sync, Option<P>: Sync,

§

impl<M, P> Unpin for ProcessObject<M, P>
where M: Unpin, Option<P>: Unpin,

§

impl<M, P> UnsafeUnpin for ProcessObject<M, P>

§

impl<M, P> UnwindSafe for ProcessObject<M, P>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more