Skip to main content

ClassDef

Struct ClassDef 

Source
pub struct ClassDef {
    pub name: &'static str,
    pub doc: &'static str,
    pub type_id: fn() -> TypeId,
    pub type_name: fn() -> &'static str,
    pub members: &'static [Member],
    pub interface: bool,
}
Expand description

What a class is: its name and members (#[class] writes it).

Fields§

§name: &'static str

Its JS name: the type’s own (Tally).

§doc: &'static str

Documentation (the struct’s doc comment).

§type_id: fn() -> TypeId

The type, telling two classes of the same name apart.

§type_name: fn() -> &'static str

The type’s Rust path, for messages (app::ledger::Ledger).

§members: &'static [Member]

Its members: the constructor, methods, accessors and statics.

§interface: bool

Its objects come from members only and its module exports no value of it: declared as an interface (#[class(interface)]: fs’s Stats).

Implementations§

Source§

impl ClassDef

Source

pub fn constructor(&self) -> Option<&'static Member>

Its constructor (new), if JS can make one.

Trait Implementations§

Source§

impl Debug for ClassDef

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for ClassDef

§

impl Freeze for ClassDef
where &'static str: Freeze, &'static [Member]: Freeze,

§

impl Move for ClassDef

§

impl RefUnwindSafe for ClassDef

§

impl Send for ClassDef
where &'static str: Send, &'static [Member]: Send,

§

impl Sync for ClassDef

§

impl Unpin for ClassDef
where &'static str: Unpin, &'static [Member]: Unpin,

§

impl UnsafeUnpin for ClassDef
where &'static str: UnsafeUnpin, &'static [Member]: UnsafeUnpin,

§

impl UnwindSafe for ClassDef
where &'static str: UnwindSafe, &'static [Member]: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.