Struct ProjectDoc
pub struct ProjectDoc { /* private fields */ }Expand description
Represents an entire sb3 program file with all Targets,
blocks (TargetBlocks) and
procedures (TargetProcedures)
See the [crate] level docs for a general explaination
Implementations§
§impl ProjectDoc
impl ProjectDoc
pub fn from_json<'a>(doc: &'a Value) -> Result<ProjectDoc, ModelError<'a>>
pub fn from_json<'a>(doc: &'a Value) -> Result<ProjectDoc, ModelError<'a>>
Parses a document from a json value
§impl ProjectDoc
Auto-generated by derive_getters::Getters.
impl ProjectDoc
Auto-generated by derive_getters::Getters.
§impl ProjectDoc
impl ProjectDoc
pub fn ids_with_opcodes( &self, ) -> impl Iterator<Item = (&Rc<str>, BlockKindUnit)>
pub fn su_ids_with_blocks( &self, ) -> impl Iterator<Item = (&Rc<str>, BlockKindUnit)>
pub fn get_block<'a>(
&'a self,
id: &Rc<str>,
) -> Result<&'a Rc<BlockWrapper>, NoValidBlockForId>
pub fn get_block<'a>( &'a self, id: &Rc<str>, ) -> Result<&'a Rc<BlockWrapper>, NoValidBlockForId>
Returns the block with the given Id regardless in which target it’s stored.
pub fn get_specific_kind<T>(
&self,
reference: &RefBlock<T>,
) -> Result<&T, BlockReferenceInvalid>where
T: WrappableKind + PartialEq,
pub fn get_specific_with_wrapper<T>(
&self,
reference: &RefBlock<T>,
) -> Result<(&T, &Rc<BlockWrapper>), BlockReferenceInvalid>where
T: WrappableKind,
Trait Implementations§
§impl Clone for ProjectDoc
impl Clone for ProjectDoc
§fn clone(&self) -> ProjectDoc
fn clone(&self) -> ProjectDoc
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ProjectDoc
impl Debug for ProjectDoc
§impl PartialEq for ProjectDoc
impl PartialEq for ProjectDoc
impl StructuralPartialEq for ProjectDoc
Auto Trait Implementations§
impl !Send for ProjectDoc
impl !Sync for ProjectDoc
impl Freeze for ProjectDoc
impl RefUnwindSafe for ProjectDoc
impl Unpin for ProjectDoc
impl UnsafeUnpin for ProjectDoc
impl UnwindSafe for ProjectDoc
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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 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> ⓘ
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