Enum ProcessStep

Source
pub enum ProcessStep<'gc, C: CustomTypes<S>, S: System<C>> {
    Idle,
    Normal,
    Yield,
    Terminate {
        result: Value<'gc, C, S>,
    },
    Abort {
        mode: AbortMode,
    },
    Broadcast {
        msg_type: Text,
        barrier: Option<Barrier>,
        targets: Option<Vec<Gc<'gc, RefLock<Entity<'gc, C, S>>>>>,
    },
    Watcher {
        create: bool,
        watcher: Watcher<'gc, C, S>,
    },
    Fork {
        pos: usize,
        locals: SymbolTable<'gc, C, S>,
        entity: Gc<'gc, RefLock<Entity<'gc, C, S>>>,
    },
    CreatedClone {
        clone: Gc<'gc, RefLock<Entity<'gc, C, S>>>,
    },
    DeletedClone {
        clone: Gc<'gc, RefLock<Entity<'gc, C, S>>>,
    },
    Pause,
}
Expand description

Result of stepping through a Process.

Variants§

§

Idle

The process was not running.

§

Normal

The process executed an instruction successfully and does not need to yield.

§

Yield

The process has signaled a yield point so that other code can run. Many yield results may occur back-to-back, such as while awaiting an asynchronous result.

Yielding is needed for executing an entire project’s scripts so that they can appear to run simultaneously. If instead you are explicitly only using a single sandboxed process, this can be treated equivalently to ProcessStep::Normal.

§

Terminate

The process has successfully terminated with the given return value.

Fields

§result: Value<'gc, C, S>
§

Abort

Aborts zero or more running processes, possibly including this one. If this process is included in the abort set, this process is guaranteed to already be terminated. For other processes, it is up to the receiver/scheduler to respect this abort request.

Fields

§

Broadcast

The process has requested to broadcast a message to all entities (if target is None) or to a specific target, which may trigger other code to execute.

Fields

§msg_type: Text
§barrier: Option<Barrier>
§targets: Option<Vec<Gc<'gc, RefLock<Entity<'gc, C, S>>>>>
§

Watcher

The process has requested to create or destroy a new watcher for a variable. If create is true, the process is requesting to register the given watcher. If create if false, the process is requesting to remove a watcher which is equivalent to the given watcher. In either case, it is up the handler of this step mode to deduplicate watchers to the same variable, if needed. The existence of a watcher is invisible to a process, so it is perfectly valid for implementors to simply ignore all watcher requests.

Fields

§create: bool
§watcher: Watcher<'gc, C, S>
§

Fork

The process has requested to fork a new process that starts with the given parameters.

Fields

§pos: usize
§locals: SymbolTable<'gc, C, S>
§entity: Gc<'gc, RefLock<Entity<'gc, C, S>>>
§

CreatedClone

The process has created a new clone of an existing entity. The clone has already been created, so this is just an informational flag for any logging or other initialization logic. Projects use this event to bind new scripts to the clone, which is an aspect of projects but not processes or entities.

Fields

§clone: Gc<'gc, RefLock<Entity<'gc, C, S>>>
§

DeletedClone

The process has requested to delete an existing clone. Projects use this event to abort all the scripts and processes associated with the deleted entity.

Fields

§clone: Gc<'gc, RefLock<Entity<'gc, C, S>>>
§

Pause

The process has requested to pause execution of the (entire) project. This can be useful for student debugging (similar to breakpoints), but can be ignored by the executor if desired.

Trait Implementations§

Source§

impl<'gc, C: CustomTypes<S>, S: System<C>> Debug for ProcessStep<'gc, C, S>
where Value<'gc, C, S>: Debug, AbortMode: Debug, Text: Debug, Option<Barrier>: Debug, Option<Vec<Gc<'gc, RefLock<Entity<'gc, C, S>>>>>: Debug, bool: Debug, Watcher<'gc, C, S>: Debug, usize: Debug, SymbolTable<'gc, C, S>: Debug, Gc<'gc, RefLock<Entity<'gc, C, S>>>: Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'gc, C, S> Freeze for ProcessStep<'gc, C, S>

§

impl<'gc, C, S> !RefUnwindSafe for ProcessStep<'gc, C, S>

§

impl<'gc, C, S> !Send for ProcessStep<'gc, C, S>

§

impl<'gc, C, S> !Sync for ProcessStep<'gc, C, S>

§

impl<'gc, C, S> Unpin for ProcessStep<'gc, C, S>

§

impl<'gc, C, S> !UnwindSafe for ProcessStep<'gc, C, S>

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> 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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 = 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.
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
Source§

impl<T> ErasedDestructor for T
where T: 'static,