Skip to main content

Action

Enum Action 

Source
#[non_exhaustive]
pub enum Action {
Show 70 variants MoveSteps { steps: Reporter, }, TurnRight { deg: Reporter, }, TurnLeft { deg: Reporter, }, GoTo { loc: Reporter, }, GoToXY { x: Reporter, y: Reporter, }, GlideSecsTo { secs: Reporter, loc: Reporter, }, GlideSecsToXY { secs: Reporter, x: Reporter, y: Reporter, }, PointInDirection { dir: Reporter, }, PointTowards { loc: Reporter, }, ChangeXBy { inc: Reporter, }, SetXTo { x: Reporter, }, ChangeYBy { inc: Reporter, }, SetYTo { y: Reporter, }, IfOnEdgeBounce, SetRotationStyle { style: RotationStyle, }, SayForSeconds { content: Reporter, secs: Reporter, }, Say { content: Reporter, }, ThinkForSeconds { content: Reporter, secs: Reporter, }, Think { content: Reporter, }, SwitchCostumeTo { costume: Reporter, }, NextCostume, SwitchBackdropTo { backdrop: Reporter, }, SwitchBackdropToAndWait { backdrop: Reporter, }, NextBackdrop, ChangeSizeBy { inc: Reporter, }, SetSizeTo { size: Reporter, }, ChangeGraphicEffectBy { effect: GraphicEffectField, inc: Reporter, }, SetGraphicEffectTo { effect: GraphicEffectField, val: Reporter, }, ClearGraphicEffects, Show, Hide, GoToLayer { front_back: FrontBackField, }, GoLayers { forward_backward: ForwardBackwardField, num: Reporter, }, PlaySoundUntilDone { sound: Reporter, }, PlaySound { sound: Reporter, }, StopAllSounds, ChangeSoundEffectBy { effect: SoundEffectField, inc: Reporter, }, SetSoundEffectTo { effect: SoundEffectField, val: Reporter, }, ClearSoundEffects, ChangeVolumeBy { inc: Reporter, }, SetVolumeTo { volume: Reporter, }, Broadcast { broadcast: Reporter, }, BroadcastAndWait { broadcast: Reporter, }, WaitSecs { secs: Reporter, }, Repeat { times: Reporter, body: Vec<Action>, }, Forever { body: Vec<Action>, }, If { cond: Reporter, then: Vec<Action>, }, IfElse { cond: Reporter, then: Vec<Action>, otherwise: Vec<Action>, }, WaitUntil { cond: Reporter, }, RepeatUntil { cond: Reporter, body: Vec<Action>, }, While { cond: Reporter, body: Vec<Action>, }, Stop { stop: StopField, }, CreateCloneOf { menu: Reporter, }, DeleteThisClone, AskAndWait { content: Reporter, }, SetDragMode { draggable: bool, }, ResetTimer, SetVariableTo { var: VarId, val: Reporter, }, ChangeVariableBy { var: VarId, inc: Reporter, }, ShowVariable { var: VarId, }, HideVariable { var: VarId, }, AddToList { list: ListId, val: Reporter, }, DeleteOfList { list: ListId, index: Reporter, }, DeleteAllOfList { list: ListId, }, InsertAtOfList { list: ListId, val: Reporter, index: Reporter, }, ReplaceItemOfListWith { list: ListId, index: Reporter, val: Reporter, }, ShowList { list: ListId, }, HideList { list: ListId, }, CallProcedure { proccode: String, args: Vec<Reporter>, }, Unknown(UnknownBlock),
}
Expand description

The representation of a Scratch action block.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

MoveSteps

Fields

§steps: Reporter
§

TurnRight

Fields

§

TurnLeft

Fields

§

GoTo

Fields

§

GoToXY

§

GlideSecsTo

Fields

§

GlideSecsToXY

§

PointInDirection

Fields

§

PointTowards

Fields

§

ChangeXBy

Fields

§

SetXTo

Fields

§

ChangeYBy

Fields

§

SetYTo

Fields

§

IfOnEdgeBounce

§

SetRotationStyle

Fields

§

SayForSeconds

Fields

§content: Reporter
§

Say

Fields

§content: Reporter
§

ThinkForSeconds

Fields

§content: Reporter
§

Think

Fields

§content: Reporter
§

SwitchCostumeTo

Fields

§costume: Reporter
§

NextCostume

§

SwitchBackdropTo

Fields

§backdrop: Reporter
§

SwitchBackdropToAndWait

Fields

§backdrop: Reporter
§

NextBackdrop

§

ChangeSizeBy

Fields

§

SetSizeTo

Fields

§

ChangeGraphicEffectBy

§

SetGraphicEffectTo

§

ClearGraphicEffects

§

Show

§

Hide

§

GoToLayer

Fields

§front_back: FrontBackField
§

GoLayers

Fields

§forward_backward: ForwardBackwardField
§

PlaySoundUntilDone

Fields

§sound: Reporter
§

PlaySound

Fields

§sound: Reporter
§

StopAllSounds

§

ChangeSoundEffectBy

Fields

§

SetSoundEffectTo

Fields

§

ClearSoundEffects

§

ChangeVolumeBy

Fields

§

SetVolumeTo

Fields

§volume: Reporter
§

Broadcast

Fields

§broadcast: Reporter
§

BroadcastAndWait

Fields

§broadcast: Reporter
§

WaitSecs

Fields

§

Repeat

Fields

§times: Reporter
§body: Vec<Action>
§

Forever

Fields

§body: Vec<Action>
§

If

Fields

§then: Vec<Action>
§

IfElse

Fields

§then: Vec<Action>
§otherwise: Vec<Action>
§

WaitUntil

Fields

§

RepeatUntil

Fields

§body: Vec<Action>
§

While

Fields

§body: Vec<Action>
§

Stop

Fields

§

CreateCloneOf

Fields

§

DeleteThisClone

§

AskAndWait

Fields

§content: Reporter
§

SetDragMode

Fields

§draggable: bool
§

ResetTimer

§

SetVariableTo

Fields

§var: VarId
§

ChangeVariableBy

Fields

§var: VarId
§

ShowVariable

Fields

§var: VarId
§

HideVariable

Fields

§var: VarId
§

AddToList

Fields

§list: ListId
§

DeleteOfList

Fields

§list: ListId
§index: Reporter
§

DeleteAllOfList

Fields

§list: ListId
§

InsertAtOfList

Fields

§list: ListId
§index: Reporter
§

ReplaceItemOfListWith

Fields

§list: ListId
§index: Reporter
§

ShowList

Fields

§list: ListId
§

HideList

Fields

§list: ListId
§

CallProcedure

Fields

§proccode: String
§

Unknown(UnknownBlock)

Trait Implementations§

Source§

impl Clone for Action

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 Debug for Action

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<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, 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.