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 Type | Output Type |
|---|---|
usize | Option<&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§
Sourcetype RefOutput
type RefOutput
Output of TimelineIndex::get_index_ref
Sourcetype MutOutput
type MutOutput
Output of TimelineIndex::get_index_mut
Required Methods§
Sourcefn get_index_ref(self, timelines: &'a [Timeline]) -> Self::RefOutput
fn get_index_ref(self, timelines: &'a [Timeline]) -> Self::RefOutput
Get the reference of timeline(s) from RanimScene by the TimelineIndex.
Sourcefn get_index_mut(self, timelines: &'a mut [Timeline]) -> Self::MutOutput
fn get_index_mut(self, timelines: &'a mut [Timeline]) -> Self::MutOutput
Get the mutable reference of timeline(s) from RanimScene by the TimelineIndex.
Implementations on Foreign Types§
Source§impl<'a> TimelineIndex<'a> for usize
impl<'a> TimelineIndex<'a> for usize
Source§impl<'a, TI: TimelineQuery<'a>, const N: usize> TimelineIndex<'a> for [TI; N]
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
fn get_index_mut(self, timelines: &'a mut [Timeline]) -> Self::MutOutput
Learnt from std::slice’s get_disjoint_mut