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: MImmutable 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: u64Millisecond timestamp of process creation.
is_active: boolWhether the fiber is currently active.
Implementations§
Source§impl<M> ProcessObject<M, PCardDefinition>
impl<M> ProcessObject<M, PCardDefinition>
Source§impl<M, P> ProcessObject<M, P>
impl<M, P> ProcessObject<M, P>
Sourcepub fn new_with_pcard(carrier: M, pcard: P) -> Self
pub fn new_with_pcard(carrier: M, pcard: P) -> Self
Constructs a ProcessObject with an explicit PCard.
Sourcepub fn with_handle(self, handle: impl Into<String>) -> Self
pub fn with_handle(self, handle: impl Into<String>) -> Self
Binds an initial handle pointer.
Sourcepub fn with_pcard(self, pcard: P) -> Self
pub fn with_pcard(self, pcard: P) -> Self
Attaches an executable PCard definition.
Sourcepub fn register_disposable<F>(&self, cleanup: F) -> Result<(), FibrationError>
pub fn register_disposable<F>(&self, cleanup: F) -> Result<(), FibrationError>
Registers a reversible cleanup callback onto the fiber’s LIFO stack.
Sourcepub fn pending_disposers_count(&self) -> Result<usize, FibrationError>
pub fn pending_disposers_count(&self) -> Result<usize, FibrationError>
Returns the number of registered disposers awaiting unwinding.
Sourcepub fn unwind(&self) -> Result<(), FibrationError>
pub fn unwind(&self) -> Result<(), FibrationError>
Unwinds all registered disposers in strict LIFO order.
Trait Implementations§
Source§impl<M: Send + Sync, P: Send + Sync> Fibration<M, P> for ProcessObject<M, P>
impl<M: Send + Sync, P: Send + Sync> Fibration<M, P> for ProcessObject<M, P>
Source§fn project(&self) -> &M
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>
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>
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>
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> Freeze for ProcessObject<M, P>
impl<M, P> RefUnwindSafe for ProcessObject<M, P>
impl<M, P> Send for ProcessObject<M, P>
impl<M, P> Sync for ProcessObject<M, P>
impl<M, P> Unpin for ProcessObject<M, P>
impl<M, P> UnsafeUnpin for ProcessObject<M, P>
impl<M, P> UnwindSafe for ProcessObject<M, P>
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