pub struct EnumCase { /* private fields */ }
Available on
phper_enum_supported
only.Expand description
Represents an enum case within a PHP enum.
EnumCase
provides a convenient way to access a specific enum case
without repeatedly calling Enum::get_case()
with the case name.
It stores a reference to the enum and the name of the case.
Implementations§
Source§impl EnumCase
impl EnumCase
Sourcepub fn get_case<'a>(&self) -> &'a ZObj
pub fn get_case<'a>(&self) -> &'a ZObj
Gets a reference to the enum case.
§Returns
A reference to ZObj representing the enum case, or an error if the case doesn’t exist
Sourcepub fn get_mut_case<'a>(&mut self) -> &'a mut ZObj
pub fn get_mut_case<'a>(&mut self) -> &'a mut ZObj
Gets a mutable reference to the enum case.
§Returns
A mutable reference to ZObj representing the enum case, or an error if the case doesn’t exist
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EnumCase
impl !RefUnwindSafe for EnumCase
impl !Send for EnumCase
impl !Sync for EnumCase
impl Unpin for EnumCase
impl !UnwindSafe for EnumCase
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