pub struct EnumBuilder { /* private fields */ }Available on crate feature
enum only.Expand description
A builder for PHP enums.
Implementations§
Source§impl EnumBuilder
impl EnumBuilder
Sourcepub fn method(
self,
method: FunctionBuilder<'static>,
flags: MethodFlags,
) -> Self
pub fn method( self, method: FunctionBuilder<'static>, flags: MethodFlags, ) -> Self
Adds a method to the enum.
Sourcepub fn registration(self, register: fn(&'static mut ClassEntry)) -> Self
pub fn registration(self, register: fn(&'static mut ClassEntry)) -> Self
Function to register the class with PHP. This function is called after the class is built.
§Parameters
register- The function to call to register the class.
Sourcepub fn docs(self, docs: DocComments) -> Self
pub fn docs(self, docs: DocComments) -> Self
Add documentation comments to the enum.
Trait Implementations§
Source§impl From<EnumBuilder> for Enum
impl From<EnumBuilder> for Enum
Source§fn from(val: EnumBuilder) -> Self
fn from(val: EnumBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for EnumBuilder
impl RefUnwindSafe for EnumBuilder
impl !Send for EnumBuilder
impl !Sync for EnumBuilder
impl Unpin for EnumBuilder
impl !UnwindSafe for EnumBuilder
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