wasmtime_cranelift::isa_builder

Struct IsaBuilder

Source
pub struct IsaBuilder<T> {
    pub lookup: fn(_: Triple) -> Result<IsaBuilder<T>>,
    /* private fields */
}
Expand description

A helper to build an Isa for a compiler implementation. Compiler builders can wrap this to provide better flexibility when setting flags.

Most methods are mirrored from the wasmtime_environ::CompilerBuilder trait, so look there for more information.

Fields§

§lookup: fn(_: Triple) -> Result<IsaBuilder<T>>

A callback to lookup a new ISA builder for a target.

Implementations§

Source§

impl<T> IsaBuilder<T>

Source

pub fn new( triple: Option<Triple>, lookup: fn(_: Triple) -> Result<Builder<T>>, ) -> Result<Self>

Create a new ISA builder with the given lookup function.

Source

pub fn triple(&self) -> &Triple

Source

pub fn target(&mut self, target: Triple) -> Result<()>

Source

pub fn settings(&self) -> Vec<Setting>

Source

pub fn set(&mut self, name: &str, value: &str) -> Result<()>

Source

pub fn enable(&mut self, name: &str) -> Result<()>

Source

pub fn build(&self) -> T

Source

pub fn shared_flags(&self) -> Flags

Auto Trait Implementations§

§

impl<T> Freeze for IsaBuilder<T>

§

impl<T> RefUnwindSafe for IsaBuilder<T>

§

impl<T> Send for IsaBuilder<T>

§

impl<T> Sync for IsaBuilder<T>

§

impl<T> Unpin for IsaBuilder<T>

§

impl<T> UnwindSafe for IsaBuilder<T>

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.