pub struct TypeAgnosticSampler<'src, T: LambdaLanguageOfThought> { /* private fields */ }Expand description
A re-usable sampler for sampling expressions of arbitrary types while caching frequent types
Implementations§
Source§impl<'src> TypeAgnosticSampler<'src, Expr<'src>>
impl<'src> TypeAgnosticSampler<'src, Expr<'src>>
Sourcepub fn sample(
&mut self,
lambda_type: LambdaType,
rng: &mut impl Rng,
) -> RootedLambdaPool<'src, Expr<'src>>
pub fn sample( &mut self, lambda_type: LambdaType, rng: &mut impl Rng, ) -> RootedLambdaPool<'src, Expr<'src>>
Samples an expression of a given type
Sourcepub fn possibles(&self) -> &PossibleExpressions<'src, Expr<'src>>
pub fn possibles(&self) -> &PossibleExpressions<'src, Expr<'src>>
Get a reference to the PossibleExpressions used by the model
Trait Implementations§
Source§impl<'src, T: Clone + LambdaLanguageOfThought> Clone for TypeAgnosticSampler<'src, T>
impl<'src, T: Clone + LambdaLanguageOfThought> Clone for TypeAgnosticSampler<'src, T>
Source§fn clone(&self) -> TypeAgnosticSampler<'src, T>
fn clone(&self) -> TypeAgnosticSampler<'src, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'src, T: Debug + LambdaLanguageOfThought> Debug for TypeAgnosticSampler<'src, T>
impl<'src, T: Debug + LambdaLanguageOfThought> Debug for TypeAgnosticSampler<'src, T>
Source§impl<'src, T: PartialEq + LambdaLanguageOfThought> PartialEq for TypeAgnosticSampler<'src, T>
impl<'src, T: PartialEq + LambdaLanguageOfThought> PartialEq for TypeAgnosticSampler<'src, T>
Source§fn eq(&self, other: &TypeAgnosticSampler<'src, T>) -> bool
fn eq(&self, other: &TypeAgnosticSampler<'src, T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'src, T: Eq + LambdaLanguageOfThought> Eq for TypeAgnosticSampler<'src, T>
impl<'src, T: LambdaLanguageOfThought> StructuralPartialEq for TypeAgnosticSampler<'src, T>
Auto Trait Implementations§
impl<'src, T> Freeze for TypeAgnosticSampler<'src, T>
impl<'src, T> RefUnwindSafe for TypeAgnosticSampler<'src, T>where
T: RefUnwindSafe,
impl<'src, T> Send for TypeAgnosticSampler<'src, T>where
T: Send,
impl<'src, T> Sync for TypeAgnosticSampler<'src, T>where
T: Sync,
impl<'src, T> Unpin for TypeAgnosticSampler<'src, T>where
T: Unpin,
impl<'src, T> UnwindSafe for TypeAgnosticSampler<'src, T>where
T: UnwindSafe,
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
An iterator over the items within this container, by reference.
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
Check whether an item is contained within this sequence.
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
Convert an item of the sequence into a [
MaybeRef].