pub struct BvhResult<'id, B: BvhBuilder> { /* private fields */ }Expand description
Result of a build, valid only inside the generative scope. Branded by 'id.
Implementations§
Source§impl<'id, B: BvhBuilder> BvhResult<'id, B>
impl<'id, B: BvhBuilder> BvhResult<'id, B>
Sourcepub fn root(&self) -> Option<&B::Node<'id>>
pub fn root(&self) -> Option<&B::Node<'id>>
The root node, or None for an empty tree (zero primitives).
Sourcepub fn resolve(&self, p: NodePtr<'id, B::Node<'id>>) -> &B::Node<'id>
pub fn resolve(&self, p: NodePtr<'id, B::Node<'id>>) -> &B::Node<'id>
Resolve a child handle to a node reference. Safe with no runtime check:
the 'id brand proves the handle came from this same build, and the
arena cannot have been freed or rebuilt – the generative build_scoped
closure that produced this BvhResult holds the &mut Bvh
exclusively for its whole duration, so no rebuild or drop can run
while 'id is live. (The returned reference borrows self, tying
it to the result handle.)
Auto Trait Implementations§
impl<'id, B> Freeze for BvhResult<'id, B>
impl<'id, B> RefUnwindSafe for BvhResult<'id, B>
impl<'id, B> Send for BvhResult<'id, B>
impl<'id, B> Sync for BvhResult<'id, B>
impl<'id, B> Unpin for BvhResult<'id, B>
impl<'id, B> UnsafeUnpin for BvhResult<'id, B>
impl<'id, B> UnwindSafe for BvhResult<'id, B>
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