pub struct Context {
pub pool_store: PoolStore,
pub locale: String,
pub watermark_map: HashMap<u64, u64>,
}Expand description
The engine context holding config and pool data.
Deliberately not Clone: pool_store holds
~2.8 MB across 151 pools, so a Context::clone() would be a silent deep
copy of tens of thousands of Strings. Nothing in the crate ever clones
a Context — pass &Context (the pattern already used throughout
pipeline.rs/entity_gen.rs/column_gen.rs) or wrap it in Arc if a
genuine shared-ownership need comes up.
Fields§
§pool_store: PoolStore§locale: String§watermark_map: HashMap<u64, u64>Implementations§
Source§impl Context
impl Context
Sourcepub fn new(domain: &str, locale: &str, pools_dir: &str) -> Result<Self, String>
pub fn new(domain: &str, locale: &str, pools_dir: &str) -> Result<Self, String>
Build a Context from a domain name + locale + path to pools directory.
Sourcepub fn enable_watermark(&mut self, domain: &str, size: usize, seed: u64)
pub fn enable_watermark(&mut self, domain: &str, size: usize, seed: u64)
Enable watermarking by computing per-column tags from the pipeline config.
Sourcepub fn watermark_3digits(&self, tag: u64) -> u64
pub fn watermark_3digits(&self, tag: u64) -> u64
Return the watermark mask for a given column tag (last 3 digits, 0..999).
Sourcepub fn watermark_2digits(&self, tag: u64) -> u64
pub fn watermark_2digits(&self, tag: u64) -> u64
Return the watermark mask for a given column tag (last 2 digits, 0..99).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
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> 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