Cmajor

Struct Cmajor 

Source
pub struct Cmajor { /* private fields */ }
Expand description

The Cmajor library.

Implementations§

Source§

impl Cmajor

Source

pub fn new() -> Self

Create a new instance of the Cmajor library.

§Panics

Panics if the library fails to load.

Source

pub fn new_from_path( path_to_library: impl AsRef<Path>, ) -> Result<Self, LibraryError>

Load the Cmajor library at the given path.

Source

pub fn new_from_env() -> Result<Self, LibraryError>

Load the Cmajor library from the path specified at the CMAJOR_LIB_PATH environment variable.

Source

pub fn version(&self) -> &str

Returns the version of the Cmajor library.

Source

pub fn parse( &self, cmajor_program: impl AsRef<str>, ) -> Result<Program, ParseError>

Parse a Cmajor program.

Source

pub fn engine_types(&self) -> impl Iterator<Item = EngineType> + '_

Returns the available engine types.

Source

pub fn create_default_engine(&self) -> EngineBuilder

Create the default engine type (LLVM JIT).

Source

pub fn create_engine(&self, engine_type: EngineType) -> EngineBuilder

Create a new engine of the given type.

Trait Implementations§

Source§

impl Default for Cmajor

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Cmajor

§

impl RefUnwindSafe for Cmajor

§

impl !Send for Cmajor

§

impl !Sync for Cmajor

§

impl Unpin for Cmajor

§

impl UnwindSafe for Cmajor

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.