Struct rhai::SwitchCasesCollection
source · pub struct SwitchCasesCollection {
pub expressions: FnArgsVec<BinaryExpr>,
pub cases: HashMap<u64, SmallVec<[usize; 2]>, StraightHasherBuilder>,
pub ranges: StaticVec<RangeCase>,
pub def_case: Option<usize>,
}
Expand description
(internals) A type containing all cases for a switch
statement.
Exported under the internals
feature only.
Fields§
§expressions: FnArgsVec<BinaryExpr>
List of conditional expressions: LHS = condition, RHS = expression.
cases: HashMap<u64, SmallVec<[usize; 2]>, StraightHasherBuilder>
Dictionary mapping value hashes to [CaseBlocksList
]’s.
ranges: StaticVec<RangeCase>
List of range cases.
def_case: Option<usize>
Statements block for the default case (there can be no condition for the default case).
Trait Implementations§
source§impl Clone for SwitchCasesCollection
impl Clone for SwitchCasesCollection
source§fn clone(&self) -> SwitchCasesCollection
fn clone(&self) -> SwitchCasesCollection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SwitchCasesCollection
impl Debug for SwitchCasesCollection
Auto Trait Implementations§
impl Freeze for SwitchCasesCollection
impl !RefUnwindSafe for SwitchCasesCollection
impl !Send for SwitchCasesCollection
impl !Sync for SwitchCasesCollection
impl Unpin for SwitchCasesCollection
impl !UnwindSafe for SwitchCasesCollection
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> Variant for T
impl<T> Variant for T
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant
trait object to &mut dyn Any
.source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant
trait object to Box<dyn Any>
.