pub struct EnumRegistry { /* private fields */ }Expand description
Registry for enum definitions
Enables enum sum types by tracking which enums exist and their variants.
Used for pattern matching resolution when matching against union types like
type SaveError = NetworkError | DiskError.
Implementations§
Source§impl EnumRegistry
impl EnumRegistry
Sourcepub fn value_matches_type(&self, value_enum_name: &str, type_name: &str) -> bool
pub fn value_matches_type(&self, value_enum_name: &str, type_name: &str) -> bool
Check if an enum value belongs to a given enum or union type
For simple enum types, checks if value_enum_name matches.
For union types (resolved from type aliases), checks if the enum
is one of the union members.
Trait Implementations§
Source§impl Clone for EnumRegistry
impl Clone for EnumRegistry
Source§fn clone(&self) -> EnumRegistry
fn clone(&self) -> EnumRegistry
Returns a duplicate 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 EnumRegistry
impl Debug for EnumRegistry
Source§impl Default for EnumRegistry
impl Default for EnumRegistry
Source§fn default() -> EnumRegistry
fn default() -> EnumRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EnumRegistry
impl RefUnwindSafe for EnumRegistry
impl Send for EnumRegistry
impl Sync for EnumRegistry
impl Unpin for EnumRegistry
impl UnsafeUnpin for EnumRegistry
impl UnwindSafe for EnumRegistry
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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