Skip to main content

TimelineIndex

Trait TimelineIndex 

Source
pub trait TimelineIndex<'a> {
    type RefOutput;
    type MutOutput;

    // Required methods
    fn get_index_ref(self, timelines: &'a [Timeline]) -> Self::RefOutput;
    fn get_index_mut(self, timelines: &'a mut [Timeline]) -> Self::MutOutput;
}
Expand description

A trait for indexing timeline(s)

RanimScene::timeline and RanimScene::timeline_mut uses the reference of TimelineIndex to index the timeline(s).

See TimelineQuery for more details.

Index TypeOutput Type
usizeOption<&Timeline> and Option<&mut Timeline>
TimelineId&Timeline and &mut Timeline
TQ: TimelineQuery<'a>TQ::RessembleResult and TQ::RessembleMutResult
[TQ: TimelineQuery<'a>; N][TQ::RessembleResult; N] and Result<[TQ::RessembleMutResult; N], TimelineIndexMutError>

Required Associated Types§

Required Methods§

Source

fn get_index_ref(self, timelines: &'a [Timeline]) -> Self::RefOutput

Get the reference of timeline(s) from RanimScene by the TimelineIndex.

Source

fn get_index_mut(self, timelines: &'a mut [Timeline]) -> Self::MutOutput

Get the mutable reference of timeline(s) from RanimScene by the TimelineIndex.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a> TimelineIndex<'a> for usize

Source§

type RefOutput = Option<&'a Timeline>

Source§

type MutOutput = Option<&'a mut Timeline>

Source§

fn get_index_ref(self, timelines: &'a [Timeline]) -> Self::RefOutput

Source§

fn get_index_mut(self, timelines: &'a mut [Timeline]) -> Self::MutOutput

Source§

impl<'a, TI: TimelineQuery<'a>, const N: usize> TimelineIndex<'a> for [TI; N]

Source§

fn get_index_mut(self, timelines: &'a mut [Timeline]) -> Self::MutOutput

Learnt from std::slice’s get_disjoint_mut

Source§

type RefOutput = [<TI as TimelineQuery<'a>>::RessembleResult; N]

Source§

type MutOutput = Result<[<TI as TimelineQuery<'a>>::RessembleMutResult; N], TimelineIndexMutError>

Source§

fn get_index_ref(self, timelines: &'a [Timeline]) -> Self::RefOutput

Implementors§