#[non_exhaustive]pub enum ClassProblem {
Cycle,
TooDeep {
limit: u32,
},
TooManyFields {
limit: u32,
},
NotAClass,
NotAnInterface,
NotAMixin,
BadDestructor,
}Expand description
A class graph or class member LSB cannot hold, or one PHP rejects at compile time.
§Examples
use bcgen_lang::ClassProblem;
assert!(ClassProblem::Cycle.to_string().contains("cycle"));
assert!(ClassProblem::TooDeep { limit: 256 }.to_string().contains("256"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Cycle
A class that is its own ancestor, or a mixin that uses itself.
TooDeep
An inheritance chain longer than limit classes (bvm-lang’s load-time
limit, MAX_INHERITANCE_DEPTH).
TooManyFields
A class whose instances would have more than limit property slots,
its ancestors’ included (an LSB field slot is 16 bits).
NotAClass
A base that is not a class of the unit (an interface, a mixin, or something that is not a class at all).
NotAnInterface
An implemented interface or interface parent that is not an interface of the unit.
NotAMixin
A used mixin that is not a mixin (PHP trait) of the unit.
BadDestructor
A destructor (see Options::destructor)
that takes parameters or is static: bvm-lang calls it with the
instance alone.
Trait Implementations§
Source§impl Clone for ClassProblem
impl Clone for ClassProblem
impl Copy for ClassProblem
Source§impl Debug for ClassProblem
impl Debug for ClassProblem
Source§impl Display for ClassProblem
impl Display for ClassProblem
impl Eq for ClassProblem
Source§impl Hash for ClassProblem
impl Hash for ClassProblem
Source§impl PartialEq for ClassProblem
impl PartialEq for ClassProblem
impl StructuralPartialEq for ClassProblem
Auto Trait Implementations§
impl Freeze for ClassProblem
impl RefUnwindSafe for ClassProblem
impl Send for ClassProblem
impl Sync for ClassProblem
impl Unpin for ClassProblem
impl UnsafeUnpin for ClassProblem
impl UnwindSafe for ClassProblem
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