Skip to main content

ModelObject

Trait ModelObject 

Source
pub trait ModelObject {
    // Required methods
    fn id(&self) -> Option<ObjectIdentity>;
    fn object_type(&self) -> ObjectTypeName;
    fn super_types(&self) -> &[ObjectTypeName];
    fn extra_context(&self) -> Option<&str>;
    fn property(&self, name: &PropertyName) -> Result<ModelValue>;
    fn links(&self) -> &[LinkName];
    fn linked_objects<'a>(
        &self,
        graph: &ModelGraph<'a>,
        max_objects: usize,
    ) -> Result<Vec<ModelObjectRef<'a>>>;
}
Expand description

Validation model object.

Required Methods§

Source

fn id(&self) -> Option<ObjectIdentity>

Optional stable object identity.

Source

fn object_type(&self) -> ObjectTypeName

Concrete object type.

Source

fn super_types(&self) -> &[ObjectTypeName]

Supertype names.

Source

fn extra_context(&self) -> Option<&str>

Extra diagnostic context.

Source

fn property(&self, name: &PropertyName) -> Result<ModelValue>

Looks up a property.

§Errors

Returns PdfvError when the property is unknown or cannot be materialized.

Link names exposed by this object.

Source

fn linked_objects<'a>( &self, graph: &ModelGraph<'a>, max_objects: usize, ) -> Result<Vec<ModelObjectRef<'a>>>

Resolves linked model objects.

§Errors

Returns PdfvError when link materialization fails.

Implementors§