pub struct DynamicType(/* private fields */);Expand description
A type known at run time (DynamicType, 7.5.2.8): a Type of the
type system model, with the introspection operations of the
specification. Cloning is cheap; named types are shared.
Implementations§
Source§impl DynamicType
impl DynamicType
Sourcepub fn new(ty: Type) -> DynamicType
pub fn new(ty: Type) -> DynamicType
The DynamicType of ty.
Sourcepub fn get_name(&self) -> String
pub fn get_name(&self) -> String
get_name: the qualified name of a named type, empty for the
others.
Sourcepub fn get_descriptor(&self) -> TypeDescriptor
pub fn get_descriptor(&self) -> TypeDescriptor
get_descriptor.
Sourcepub fn get_member_count(&self) -> u32
pub fn get_member_count(&self) -> u32
get_member_count: the members of a struct (those of its base
types first) or a union, the literals of an enum, the flags of a
bitmask; 0 for the other types.
Sourcepub fn get_member_by_index(&self, index: u32) -> Option<DynamicTypeMember>
pub fn get_member_by_index(&self, index: u32) -> Option<DynamicTypeMember>
get_member_by_index.
Sourcepub fn get_member(&self, id: u32) -> Option<DynamicTypeMember>
pub fn get_member(&self, id: u32) -> Option<DynamicTypeMember>
get_member: by member ID (for an enum, the value of a literal;
for a bitmask, the position of a flag).
Sourcepub fn get_member_by_name(&self, name: &str) -> Option<DynamicTypeMember>
pub fn get_member_by_name(&self, name: &str) -> Option<DynamicTypeMember>
get_member_by_name.
Sourcepub fn is_keyed(&self) -> bool
pub fn is_keyed(&self) -> bool
Whether the type has key members (a struct with @key members,
its base’s included): its samples are of instances.
Sourcepub fn members(&self) -> Vec<DynamicTypeMember>
pub fn members(&self) -> Vec<DynamicTypeMember>
get_all_members, in order.
Sourcepub fn equals(&self, other: &DynamicType) -> bool
pub fn equals(&self, other: &DynamicType) -> bool
equals.
Trait Implementations§
Source§impl Clone for DynamicType
impl Clone for DynamicType
Source§fn clone(&self) -> DynamicType
fn clone(&self) -> DynamicType
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 DynamicType
impl Debug for DynamicType
Source§impl From<Type> for DynamicType
impl From<Type> for DynamicType
Source§fn from(ty: Type) -> DynamicType
fn from(ty: Type) -> DynamicType
Converts to this type from the input type.
Source§impl PartialEq for DynamicType
impl PartialEq for DynamicType
impl StructuralPartialEq for DynamicType
Auto Trait Implementations§
impl Forget for DynamicType
impl Freeze for DynamicType
impl Move for DynamicType
impl RefUnwindSafe for DynamicType
impl Send for DynamicType
impl Sync for DynamicType
impl Unpin for DynamicType
impl UnsafeUnpin for DynamicType
impl UnwindSafe for DynamicType
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