pub struct RawBlock {
pub opcode: String,
pub next: Option<String>,
pub parent: Option<String>,
pub inputs: HashMap<String, RawBlockInput>,
pub fields: HashMap<String, (String, Option<String>)>,
pub top_level: bool,
}Expand description
The RawBlock struct represents a block in its raw form in a Scratch 3.0 project.
It contains the opcode, inputs, fields, next block, parent block, and shadow status.
Please refer to the Scratch Wiki for more details on the structure of blocks in Scratch projects.
Fields§
§opcode: StringThe opcode of the block (e.g., “event_whenflagclicked”, “motion_movesteps”).
next: Option<String>The next block ID in the sequence. None if there is no next block and the script ends
here.
parent: Option<String>The previous block ID in the sequence if the block is a top-level block. If not, and this block is a child of another block, this will link to the caller block.
inputs: HashMap<String, RawBlockInput>The inputs to the block, represented as a map from input name to a RawBlockInput.
fields: HashMap<String, (String, Option<String>)>The fields of the block, represented as a map from field name to a tuple containing a variable name and its ID.
top_level: boolIndicates whether the block is a top-level block in a script (cap block).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RawBlock
impl<'de> Deserialize<'de> for RawBlock
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RawBlock
impl RefUnwindSafe for RawBlock
impl Send for RawBlock
impl Sync for RawBlock
impl Unpin for RawBlock
impl UnwindSafe for RawBlock
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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