Skip to main content

ClassType

Struct ClassType 

Source
pub struct ClassType {
    pub name: &'static str,
    pub type_id: fn() -> TypeId,
    pub create_instance: fn() -> Box<dyn BsonObject>,
    pub properties: &'static [PropertyInfo],
    pub is_expando: bool,
}
Expand description

A class, as declared: what the original reads from the System.Type of an object. [bson_class!] writes one.

Fields§

§name: &'static str

Type.Name.

§type_id: fn() -> TypeId

The identity of the Rust type.

§create_instance: fn() -> Box<dyn BsonObject>

Activator.CreateInstance(type, true).

§properties: &'static [PropertyInfo]

The properties in the order Type.GetProperties returns them: the ones the class declares, then the ones of its base classes.

§is_expando: bool

typeof(IExpando).IsAssignableFrom(type).

Implementations§

Source§

impl ClassType

Source

pub fn id(&self) -> TypeId

The identity of the Rust type: the key of every table over types.

Trait Implementations§

Source§

impl Debug for ClassType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.