pub struct PmiAnnotation {
pub kind: String,
pub enabled: bool,
pub params: Value,
pub label_world: Option<[f64; 3]>,
}Expand description
One annotation: schema-driven params keyed by its type.
Fields§
§kind: String§enabled: bool§params: Value§label_world: Option<[f64; 3]>The draggable label’s world anchor. Absent until the user moves it — the report then carries a default derived from the geometry.
Implementations§
Source§impl PmiAnnotation
impl PmiAnnotation
Sourcepub fn text(&self, key: &str) -> &str
pub fn text(&self, key: &str) -> &str
A string param, trimmed ("" when absent or not a string).
Sourcepub fn number(&self, key: &str, env: &Env, default: f64) -> Result<f64, String>
pub fn number(&self, key: &str, env: &Env, default: f64) -> Result<f64, String>
A numeric param: a JSON number, or a string evaluated as an expression
against the document’s variable sheet. default when absent / empty.
Sourcepub fn plane_ref(&self) -> Option<&str>
pub fn plane_ref(&self) -> Option<&str>
The plane reference (a planar face / reference plane name), when
the annotation is laid out in a picked plane rather than the view.
Sourcepub fn references(&self, key: &str) -> Vec<String>
pub fn references(&self, key: &str) -> Vec<String>
A reference param as a name list: a string, or an array of strings (empty strings dropped).
Trait Implementations§
Source§impl Clone for PmiAnnotation
impl Clone for PmiAnnotation
Source§fn clone(&self) -> PmiAnnotation
fn clone(&self) -> PmiAnnotation
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 moreSource§impl Debug for PmiAnnotation
impl Debug for PmiAnnotation
Source§impl<'de> Deserialize<'de> for PmiAnnotation
impl<'de> Deserialize<'de> for PmiAnnotation
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PmiAnnotation
impl PartialEq for PmiAnnotation
Source§impl Serialize for PmiAnnotation
impl Serialize for PmiAnnotation
impl StructuralPartialEq for PmiAnnotation
Auto Trait Implementations§
impl Freeze for PmiAnnotation
impl RefUnwindSafe for PmiAnnotation
impl Send for PmiAnnotation
impl Sync for PmiAnnotation
impl Unpin for PmiAnnotation
impl UnsafeUnpin for PmiAnnotation
impl UnwindSafe for PmiAnnotation
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