Struct glslt::transform::Unit

source ·
pub struct Unit { /* private fields */ }
Expand description

GLSLT template instantiation context

Implementations§

source§

impl Unit

source

pub fn new() -> Self

Create a new transform unit

source

pub fn with_context(global_scope: GlobalScope) -> Self

Create a new transform unit using pre-defined templates

Parameters
  • global_scope: context to pull pre-defined templates from
source

pub fn with_config(config: TransformConfig) -> Self

Create a new transform unit with the given configuration

Parameters
  • config: transform configuration
source

pub fn into_translation_unit(self) -> Result<TranslationUnit>

Transform this unit into a GLSL syntax tree

All the declarations given as input will be included in-order in the output, with the template instantiations interleaved when needed.

Trait Implementations§

source§

impl Clone for Unit

source§

fn clone(&self) -> Unit

Returns a copy 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 Debug for Unit

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for Unit

source§

fn default() -> Unit

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

impl TransformUnit for Unit

source§

fn global_scope(&self) -> &GlobalScope

Obtain a reference to the template definition context
source§

fn global_scope_mut(&mut self) -> &mut GlobalScope

Obtain a mutable reference to the template definition context
source§

fn push_function_declaration(&mut self, def: FunctionDefinition)

Add a function declaration to the transform unit Read more
source§

fn parse_external_declaration( &mut self, extdecl: ExternalDeclaration ) -> Result<Option<FnHandle<'_>>>

Parse a GLSLT declaration and add it to the transform unit Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Unit

§

impl Send for Unit

§

impl Sync for Unit

§

impl Unpin for Unit

§

impl UnwindSafe for Unit

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.