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