#[repr(u8)]pub enum SceneId {
Show 16 variants
One = 0,
Two = 1,
Three = 2,
Four = 3,
Five = 4,
Six = 5,
Seven = 6,
Eight = 7,
Nine = 8,
Ten = 9,
Eleven = 10,
Twelve = 11,
Thirteen = 12,
Fourteen = 13,
Fifteen = 14,
Sixteen = 15,
}Expand description
Identifier values for Scenes, allowing for panic-free indexing via id* methods.
use ot_tools_io::parts::{SceneXlvAssignments};
use ot_tools_io::identifiers::{SavedState, PartId, SceneId};
use ot_tools_io::BankFile;
// mutable ref so we can demonstrate using `id_mut` methods
let mut bank = BankFile::default();
let part_one_working = bank
.parts_mut(&SavedState::Working)
.id_mut(&PartId::One);
// using variant by hand
// -- scene 1 (reference)
part_one_working.scene_xlvs.id_ref(&SceneId::One);
// -- scene 16 (mutable reference)
part_one_working.scene_xlvs.id_mut(&SceneId::Sixteen);
// lookup from an unsigned integer value
// failed conversions return an `OtToolsIoError::InvalidIndex` error for you to handle
// -- scene 1 (reference)
part_one_working.scene_xlvs.id_ref(&SceneId::try_from(0_usize)?);
// -- scene 16 (mutable reference)
part_one_working.scene_xlvs.id_mut(&SceneId::try_from(15_usize)?);
// iterate over variants
for scene_id in SceneId::iter() {
part_one_working.scene_xlvs.id_ref(&scene_id);
}
Variants§
One = 0
Two = 1
Three = 2
Four = 3
Five = 4
Six = 5
Seven = 6
Eight = 7
Nine = 8
Ten = 9
Eleven = 10
Twelve = 11
Thirteen = 12
Fourteen = 13
Fifteen = 14
Sixteen = 15
Implementations§
Trait Implementations§
impl Copy for SceneId
impl Eq for SceneId
Source§impl Ord for SceneId
impl Ord for SceneId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for SceneId
impl PartialOrd for SceneId
Source§impl Sequence for SceneId
impl Sequence for SceneId
impl StructuralPartialEq for SceneId
Auto Trait Implementations§
impl Freeze for SceneId
impl RefUnwindSafe for SceneId
impl Send for SceneId
impl Sync for SceneId
impl Unpin for SceneId
impl UnsafeUnpin for SceneId
impl UnwindSafe for SceneId
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§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