pub struct CompileContext<'a> { /* private fields */ }Expand description
Everything a factory needs to compile a config into a runtime operator:
the table and (for column-scoped operators) the column being compiled, the
run’s SeedRoot, and the config’s YAML path for diagnostics.
It is Copy so factories can freely pass it down without ceremony.
Implementations§
Source§impl<'a> CompileContext<'a>
impl<'a> CompileContext<'a>
Sourcepub fn for_column(
table: &'a PortableTable,
column: &'a PortableColumn,
seed: SeedRoot,
path: &'a str,
) -> Self
pub fn for_column( table: &'a PortableTable, column: &'a PortableColumn, seed: SeedRoot, path: &'a str, ) -> Self
Context for a column-scoped operator (generator or modifier).
Sourcepub fn for_table(
table: &'a PortableTable,
seed: SeedRoot,
path: &'a str,
) -> Self
pub fn for_table( table: &'a PortableTable, seed: SeedRoot, path: &'a str, ) -> Self
Context for a table-scoped operator (planner), where no single column owns the compilation.
Sourcepub fn table(&self) -> &'a PortableTable
pub fn table(&self) -> &'a PortableTable
The table this operator belongs to.
Sourcepub fn column(&self) -> Option<&'a PortableColumn>
pub fn column(&self) -> Option<&'a PortableColumn>
The column being compiled, if this is a column-scoped operator.
Sourcepub fn path(&self) -> &'a str
pub fn path(&self) -> &'a str
The config’s YAML path, for attaching diagnostics to the right place.
Sourcepub fn rng(&self, id: StreamId) -> ChaCha8Rng
pub fn rng(&self, id: StreamId) -> ChaCha8Rng
Derive the deterministic RNG stream for the given identity. Convenience
over self.seed().stream(id).
Trait Implementations§
Source§impl<'a> Clone for CompileContext<'a>
impl<'a> Clone for CompileContext<'a>
Source§fn clone(&self) -> CompileContext<'a>
fn clone(&self) -> CompileContext<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for CompileContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for CompileContext<'a>
impl<'a> RefUnwindSafe for CompileContext<'a>
impl<'a> Send for CompileContext<'a>
impl<'a> Sync for CompileContext<'a>
impl<'a> Unpin for CompileContext<'a>
impl<'a> UnsafeUnpin for CompileContext<'a>
impl<'a> UnwindSafe for CompileContext<'a>
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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