pub struct PointerDefBuilder<'shape> { /* private fields */ }Expand description
Builder for creating a PointerDef.
Implementations§
Source§impl<'shape> PointerDefBuilder<'shape>
impl<'shape> PointerDefBuilder<'shape>
Sourcepub const fn vtable(self, vtable: &'shape PointerVTable<'_>) -> Self
pub const fn vtable(self, vtable: &'shape PointerVTable<'_>) -> Self
Sets the vtable for the 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 pointer.
Sourcepub const fn flags(self, flags: PointerFlags) -> Self
pub const fn flags(self, flags: PointerFlags) -> Self
Sets the flags for the pointer.
Sourcepub const fn known(self, known: KnownPointer) -> Self
pub const fn known(self, known: KnownPointer) -> Self
Sets the known 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) -> PointerDef<'shape>
pub const fn build(self) -> PointerDef<'shape>
Builds a PointerDef from the provided configuration.
§Panics
Panics if any required field (vtable, flags) is not set.
Trait Implementations§
Auto Trait Implementations§
impl<'shape> Freeze for PointerDefBuilder<'shape>
impl<'shape> RefUnwindSafe for PointerDefBuilder<'shape>
impl<'shape> Send for PointerDefBuilder<'shape>
impl<'shape> Sync for PointerDefBuilder<'shape>
impl<'shape> Unpin for PointerDefBuilder<'shape>
impl<'shape> UnwindSafe for PointerDefBuilder<'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