pub struct SmartPointerDefBuilder<'shape> { /* private fields */ }Expand description
Builder for creating a SmartPointerDef.
Implementations§
Source§impl<'shape> SmartPointerDefBuilder<'shape>
impl<'shape> SmartPointerDefBuilder<'shape>
Sourcepub const fn vtable(self, vtable: &'shape SmartPointerVTable) -> Self
pub const fn vtable(self, vtable: &'shape SmartPointerVTable) -> Self
Sets the vtable for the smart pointer.
Sourcepub const fn pointee(self, pointee: fn() -> &'shape Shape<'shape>) -> Self
pub const fn pointee(self, pointee: fn() -> &'shape Shape<'shape>) -> Self
Sets the shape of the inner type of the smart pointer.
Sourcepub const fn flags(self, flags: SmartPointerFlags) -> Self
pub const fn flags(self, flags: SmartPointerFlags) -> Self
Sets the flags for the smart pointer.
Sourcepub const fn known(self, known: KnownSmartPointer) -> Self
pub const fn known(self, known: KnownSmartPointer) -> Self
Sets the known smart pointer type.
Sourcepub const fn weak(self, weak: fn() -> &'shape Shape<'shape>) -> Self
pub const fn weak(self, weak: fn() -> &'shape Shape<'shape>) -> Self
Sets the shape of the corresponding weak pointer, if this pointer is strong.
Sourcepub const fn strong(self, strong: fn() -> &'shape Shape<'shape>) -> Self
pub const fn strong(self, strong: fn() -> &'shape Shape<'shape>) -> Self
Sets the shape of the corresponding strong pointer, if this pointer is weak
Sourcepub const fn build(self) -> SmartPointerDef<'shape>
pub const fn build(self) -> SmartPointerDef<'shape>
Builds a SmartPointerDef from the provided configuration.
§Panics
Panics if any required field (vtable, flags) is not set.
Trait Implementations§
Auto Trait Implementations§
impl<'shape> Freeze for SmartPointerDefBuilder<'shape>
impl<'shape> RefUnwindSafe for SmartPointerDefBuilder<'shape>
impl<'shape> Send for SmartPointerDefBuilder<'shape>
impl<'shape> Sync for SmartPointerDefBuilder<'shape>
impl<'shape> Unpin for SmartPointerDefBuilder<'shape>
impl<'shape> UnwindSafe for SmartPointerDefBuilder<'shape>
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