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