pub struct Block {Show 34 fields
pub block_type: String,
pub name: String,
pub sid: Option<String>,
pub tag_name: String,
pub position: Option<String>,
pub zorder: Option<String>,
pub commented: bool,
pub name_location: NameLocation,
pub is_matlab_function: bool,
pub value: Option<String>,
pub value_kind: ValueKind,
pub value_rows: Option<u32>,
pub value_cols: Option<u32>,
pub properties: IndexMap<String, String>,
pub ref_properties: BTreeSet<String>,
pub port_counts: Option<PortCounts>,
pub ports: Vec<Port>,
pub subsystem: Option<Box<System>>,
pub system_ref: Option<String>,
pub c_function: Option<CFunctionCode>,
pub instance_data: Option<InstanceData>,
pub link_data: Option<LinkData>,
pub mask: Option<Mask>,
pub annotations: Vec<Annotation>,
pub background_color: Option<String>,
pub show_name: Option<bool>,
pub font_size: Option<u32>,
pub font_weight: Option<String>,
pub mask_display_text: Option<String>,
pub current_setting: Option<String>,
pub block_mirror: Option<bool>,
pub library_source: Option<String>,
pub library_block_path: Option<String>,
pub child_order: Vec<BlockChildKind>,
}Expand description
A Simulink block or reference.
The properties map preserves the original insertion order of <P> elements
and stores all <P> values (including Position, ZOrder, etc.) so that
system XML files can be exactly regenerated.
Properties that use the XML Ref attribute instead of text content
are tracked in ref_properties.
Fields§
§block_type: StringBlock type (e.g. “Gain”, “SubSystem”, “Reference”).
name: String§sid: Option<String>§tag_name: StringXML element tag name: "Block" or "Reference".
position: Option<String>Convenience: parsed Position string (also stored in properties).
zorder: Option<String>Convenience: parsed ZOrder string (also stored in properties).
commented: bool§name_location: NameLocationLocation of the block name label (defaults to Bottom if not specified).
is_matlab_function: boolTrue if this block is a Stateflow MATLAB Function block.
value: Option<String>Optional block value as text (e.g., for Constant blocks).
value_kind: ValueKindParsed value kind (scalar/vector/matrix).
value_rows: Option<u32>§value_cols: Option<u32>§properties: IndexMap<String, String>Ordered map of all <P> element key-value pairs, including Position
and ZOrder in their original order.
ref_properties: BTreeSet<String>Names of properties whose XML value is stored in a Ref attribute
rather than as text content (e.g., LibrarySourceProduct).
port_counts: Option<PortCounts>PortCounts element (<PortCounts in="…" out="…"/>).
None means no <PortCounts> element in the XML.
ports: Vec<Port>§subsystem: Option<Box<System>>Resolved nested system (subsystem content).
system_ref: Option<String>If the <System> child used a Ref attribute (e.g., Ref="system_18"),
this field stores that reference name for round-trip output.
c_function: Option<CFunctionCode>Present when this is a CFunction block.
instance_data: Option<InstanceData>Optional per-instance data.
link_data: Option<LinkData>Optional link data (preserves pass-through dialog parameters).
mask: Option<Mask>Optional Simulink mask.
annotations: Vec<Annotation>Annotations attached to the block.
background_color: Option<String>Convenience: parsed background color.
show_name: Option<bool>Convenience: parsed show-name flag.
font_size: Option<u32>Convenience: parsed font size.
font_weight: Option<String>Convenience: parsed font weight.
mask_display_text: Option<String>Evaluated display text from mask’s Display script.
current_setting: Option<String>Optional current setting for blocks like ManualSwitch.
block_mirror: Option<bool>Whether the block is mirrored.
library_source: Option<String>Library source name this block was copied from.
library_block_path: Option<String>Full library block path.
child_order: Vec<BlockChildKind>Order of child XML elements inside this block, used for round-trip XML generation. When empty, a default order is used.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Block
impl<'de> Deserialize<'de> for Block
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 Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
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> 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>
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