Struct

Struct Struct 

Source
#[repr(align(8))]
pub struct Struct { /* private fields */ }
Expand description

The innards of a struct.

Note that both types and actual constructed structs use the same representation. The difference is that types do not contain associated fields (Mica does not have static fields.)

Implementations§

Source§

impl Struct

Source

pub fn new_type(dtable: GcRaw<DispatchTable>) -> Self

Creates a new Struct representing a type.

Source

pub unsafe fn dtable<'a>(&self) -> &'a DispatchTable

Returns a reference to the dispatch table of the struct.

§Safety

Note that the reference’s lifetime does not match the struct’s. This is because the reference actually comes from the GC, but Struct does not have a lifetime parameter that would signify that.

Because the lifetime of the reference is not tracked, this function is unsafe.

Auto Trait Implementations§

§

impl !Freeze for Struct

§

impl !RefUnwindSafe for Struct

§

impl !Send for Struct

§

impl !Sync for Struct

§

impl Unpin for Struct

§

impl !UnwindSafe for Struct

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.