pub struct SimpleSamplerResources { /* private fields */ }Expand description
Simple resources that can provide an RNG and/or last tokens to samplers.
Implementations§
Trait Implementations§
Source§impl Debug for SimpleSamplerResources
impl Debug for SimpleSamplerResources
Source§impl HasSamplerResources for SimpleSamplerResources
impl HasSamplerResources for SimpleSamplerResources
Source§fn with_rng_mut(
&mut self,
fun: &mut dyn FnMut(&mut dyn RngCore),
) -> Result<(), SamplerError>
fn with_rng_mut( &mut self, fun: &mut dyn FnMut(&mut dyn RngCore), ) -> Result<(), SamplerError>
Allows a sampler to mutably access the RNG (if present).
Source§fn with_last_tokens(
&self,
fun: &mut dyn FnMut(&[TID]),
) -> Result<(), SamplerError>
fn with_last_tokens( &self, fun: &mut dyn FnMut(&[TID]), ) -> Result<(), SamplerError>
Allows a sampler to immutably access the last tokens (if present).
Source§fn with_last_tokens_mut(
&mut self,
fun: &mut dyn FnMut(&mut Vec<TID>),
) -> Result<(), SamplerError>
fn with_last_tokens_mut( &mut self, fun: &mut dyn FnMut(&mut Vec<TID>), ) -> Result<(), SamplerError>
Allows a sampler to mutably access the last tokens (if present).
Auto Trait Implementations§
impl Freeze for SimpleSamplerResources
impl !RefUnwindSafe for SimpleSamplerResources
impl Send for SimpleSamplerResources
impl Sync for SimpleSamplerResources
impl Unpin for SimpleSamplerResources
impl !UnwindSafe for SimpleSamplerResources
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