Struct janetrs::JanetAbstract[][src]

#[repr(transparent)]
pub struct JanetAbstract { /* fields omitted */ }
Expand description

Type that represents the Janet Abstract type.

Janet Abstract types is the way to expose non-native types to the Janet Runtime and allow the Janet user to interact with them.

It works like a *mut c_void pointer, but the memory it uses are tracked by the Janet Garbage Collector.

Implementations

Creates a JanetAbstract using information from the type that can be used as JanetAbstract

Creates a JanetAbstract from a raw pointer

Safety

This function doesn’t check anything.

Returns a reference to the abstract type data as A

Safety

This function doesn’t check if the underlying data of the JanetAbstract object and the requested type A are the same.

Returns a mutable reference to the abstract type data as A

Safety

This function doesn’t check if the underlying data of the JanetAbstract object and the requested type A are the same.

Check if the JanetAbstract data is of the type A.

Returns a reference to value if it’s the same kind of abstract.

Error

This function may return AbstractError::MismatchedSize if this object size is different of requested type A size, or AbstractError::MismatchedAbstractType if any of the function pointer in the JanetAbstractType are different.

Returns a exclusive reference to value if it’s the same kind of abstract.

Error

This function may return AbstractError::MismatchedSize if this object size is different of requested type A size, or AbstractError::MismatchedAbstractType if any of the function pointer in the JanetAbstractType are different.

Acquires the underlying pointer as const pointer.

Acquires the underlying pointer.

Casts to a pointer of another type.

Return the size of the type it holds.

Return the struct that holds the type name and all possible polimorfic function pointer that a Abstract type can have in Janet.

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.