Struct BlockWrapper
pub struct BlockWrapper { /* private fields */ }Expand description
This wraps a Scratch block
It stores the unique Id of the block Scratch has assigned to it,
the Id of the next block (especially important for statements)
and the parent block (parent is not actively used in the application).
parent is not the defined to be the previous block (next and parent don’t form a double-linked-list) but it can be the next-outer-block in the hierarchy. See here for details
Implementations§
§impl BlockWrapper
Auto-generated by derive_getters::Getters.
impl BlockWrapper
Auto-generated by derive_getters::Getters.
pub fn id(&self) -> &Rc<str>
pub fn id(&self) -> &Rc<str>
The unique id of this block, alphanumeric and special characters are used
pub fn parent(&self) -> &Option<Rc<str>>
pub fn parent(&self) -> &Option<Rc<str>>
parent is not actively used in the application
parent is not the defined to be the previous block (next and parent don’t form a double-linked-list) but it can be the next-outer-block in the hierarchy. See here for details
pub fn shadow(&self) -> &bool
pub fn shadow(&self) -> &bool
not needed for the application, but it is present in the file so it’s parsed
pub fn top_level_pos(&self) -> &Option<Position>
pub fn top_level_pos(&self) -> &Option<Position>
topLevel/x/y is the position of blocks, if they are top-level
If and (as it seems) only if the property topLevel is set to true,
the two properties x and y are also present.
They then form the position of the block on a grid.
Trait Implementations§
§impl Debug for BlockWrapper
impl Debug for BlockWrapper
§impl PartialEq for BlockWrapper
impl PartialEq for BlockWrapper
impl StructuralPartialEq for BlockWrapper
Auto Trait Implementations§
impl !Send for BlockWrapper
impl !Sync for BlockWrapper
impl Freeze for BlockWrapper
impl RefUnwindSafe for BlockWrapper
impl Unpin for BlockWrapper
impl UnsafeUnpin for BlockWrapper
impl UnwindSafe for BlockWrapper
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