Struct dae_parser::Instance [−][src]
pub struct Instance<T: Instantiate> {
pub sid: Option<String>,
pub url: UrlRef<T>,
pub data: T::Data,
pub extra: Vec<Extra>,
}
Expand description
Instantiates a COLLADA material resource, possibly applying transformations or effects to the object.
The data
field depends on the type of object being instantiated.
Most types use ()
for this field but some types have additional data:
Instance<
Geometry
>:InstanceGeometryData
Instance<
Controller
>:InstanceControllerData
Instance<
Effect
>:InstanceEffectData
Instance<
PhysicsModel
>:InstancePhysicsModelData
Additionally, some instance nodes are even more different and have their own types:
InstanceMaterial
, notInstance<
Material
>
InstanceRigidBody
, notInstance<
RigidBody
>
InstanceRigidConstraint
, notInstance<
RigidConstraint
>
Fields
sid: Option<String>
A text string containing the scoped identifier of this element. This value must be unique within the scope of the parent element.
url: UrlRef<T>
The URL of the location of the T
element to instantiate.
Can refer to a local instance or external reference.
data: T::Data
The additional data associated with the instantiation, if any.
extra: Vec<Extra>
Provides arbitrary additional information about this element.
Implementations
Get the list of InstanceMaterial
s bound in this Instance<Geometry>
.
Trait Implementations
Parse an XML element into this type. In most cases, the parser will require with a
debug_assert
that the element to parse has name Self::NAME
. Read more
Parse an XML element and return the data structure in a Box
.
This can be faster in some cases when the data structure is large. Read more
Parse a single required element from the given element iterator.
Parse an optional element from the given element iterator, using Self::NAME
to
determine if it is the correct type. Read more
Parse an optional boxed element from the given element iterator, using Self::NAME
to
determine if it is the correct type. Read more
Parse a list of elements from the given element iterator,
as long as it continues yielding elements of name Self::NAME
. Read more
Parse a list of elements from the given element iterator,
as long as it continues yielding elements of name Self::NAME
,
and assert that the resulting list has length at least N
. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Instance<T> where
T: RefUnwindSafe,
<T as Instantiate>::Data: RefUnwindSafe,
impl<T> UnwindSafe for Instance<T> where
T: UnwindSafe,
<T as Instantiate>::Data: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more