pub struct ObjectType<T: 'static> { /* private fields */ }Expand description
The ObjectType struct is used to define the methods of an object type. Once all methods are
called, the ObjectType::seal method should be called. This consumes the ObjectType and returns
a SealedObjectType that can be used to instantiate objects.
Implementations§
Source§impl<T: 'static> ObjectType<T>
impl<T: 'static> ObjectType<T>
Sourcepub fn add_method(&mut self, name: &str, method: &'static dyn Method<T>)
pub fn add_method(&mut self, name: &str, method: &'static dyn Method<T>)
Adds a method to the ObjectType
Sourcepub fn add_method_mut(&mut self, name: &str, method: &'static dyn MethodMut<T>)
pub fn add_method_mut(&mut self, name: &str, method: &'static dyn MethodMut<T>)
Adds a method to the ObjectType that allows mutation of the object
Sourcepub fn seal(self) -> SealedObjectType<T>
pub fn seal(self) -> SealedObjectType<T>
Consumes the ObjectType and returns a SealedObjectType. The SealedObjectType is immutable but is required to instantiate objects.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ObjectType<T>
impl<T> !RefUnwindSafe for ObjectType<T>
impl<T> !Send for ObjectType<T>
impl<T> !Sync for ObjectType<T>
impl<T> Unpin for ObjectType<T>
impl<T> !UnwindSafe for ObjectType<T>
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