Struct redact_composer_core::render::context::CompositionContext
source · pub struct CompositionContext<'a> { /* private fields */ }
Expand description
Provides access to common utilities, such as methods to lookup other composition tree nodes, or Rng.
This struct is provided as an argument to Renderer::render
.
Implementations§
source§impl<'a> CompositionContext<'a>
impl<'a> CompositionContext<'a>
sourcepub fn find<Element: Element>(
&self
) -> CtxQuery<'_, Element, impl Fn(&Element) -> bool>
pub fn find<Element: Element>( &self ) -> CtxQuery<'_, Element, impl Fn(&Element) -> bool>
Search the in-progress composition tree for nodes of type Element
.
Returns a CtxQuery
, allowing further specifications before running the search.
sourcepub fn beat_length(&self) -> i32
pub fn beat_length(&self) -> i32
Returns the composition beat length. A composition’s tempo (BPM) is relative to this value.
sourcepub fn rng(&self) -> impl Rng
pub fn rng(&self) -> impl Rng
Creates an Rng
seeded from the currently rendering segment’s seed.
sourcepub fn rng_with_seed(&self, seed: impl Hash) -> impl Rng
pub fn rng_with_seed(&self, seed: impl Hash) -> impl Rng
Creates an Rng
seeded from a combination of the currently rendering segment’s seed
as well as the provided seed.
Trait Implementations§
source§impl Clone for CompositionContext<'_>
impl Clone for CompositionContext<'_>
source§impl<'a> Debug for CompositionContext<'a>
impl<'a> Debug for CompositionContext<'a>
impl Copy for CompositionContext<'_>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CompositionContext<'a>
impl<'a> !Send for CompositionContext<'a>
impl<'a> !Sync for CompositionContext<'a>
impl<'a> Unpin for CompositionContext<'a>
impl<'a> !UnwindSafe for CompositionContext<'a>
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