CompilationJob

Struct CompilationJob 

Source
pub struct CompilationJob<T, F> { /* private fields */ }
Expand description

The interface of LUNIR’s compilation pipeline. CompilationJob allows you to pass in parameters to the LUNIR compilation pipeline and invoke it, even across threads.

Implementations§

Source§

impl<'a, T> CompilationJob<T, NoSerializer>

Source

pub fn serializer<S: Fn(IlChunk) -> Vec<u8>>( self, serializer: S, ) -> CompilationJob<T, WithSerializer<S>>

Adds a target format serializer function to this CompilationJob to allow it to produce a final bytecode.

Source§

impl<'a, F> CompilationJob<NoTree, F>

Source

pub fn tree(self, tree: &'a Node) -> CompilationJob<WithTree<'a>, F>

Adds a source abstract syntax tree to this CompilationJob.

Source§

impl<'a, S: Fn(IlChunk) -> Vec<u8>> CompilationJob<WithTree<'a>, WithSerializer<S>>

Source

pub fn run(self) -> Vec<u8>

Invokes LUNIR’s compilation pipeline with the parameters passed through the CompilationJob. This will consume the job.

Trait Implementations§

Source§

impl<T: Clone, F: Clone> Clone for CompilationJob<T, F>

Source§

fn clone(&self) -> CompilationJob<T, F>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, F: Debug> Debug for CompilationJob<T, F>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T, F> Freeze for CompilationJob<T, F>
where F: Freeze, T: Freeze,

§

impl<T, F> RefUnwindSafe for CompilationJob<T, F>

§

impl<T, F> Send for CompilationJob<T, F>
where F: Send, T: Send,

§

impl<T, F> Sync for CompilationJob<T, F>
where F: Sync, T: Sync,

§

impl<T, F> Unpin for CompilationJob<T, F>
where F: Unpin, T: Unpin,

§

impl<T, F> UnwindSafe for CompilationJob<T, F>
where F: UnwindSafe, T: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.