pub struct HullDatabase { /* private fields */ }Expand description
Shared hull store for a world. (b3HullMap + world->hullDatabase)
Implementations§
Source§impl HullDatabase
impl HullDatabase
pub fn new() -> Self
Sourcepub fn add(&mut self, src: &HullData) -> Rc<HullData>
pub fn add(&mut self, src: &HullData) -> Rc<HullData>
Clone src into the database on miss; share on hit.
(b3AddHullToDatabase)
Sourcepub fn add_owned(&mut self, owned: HullData) -> Rc<HullData>
pub fn add_owned(&mut self, owned: HullData) -> Rc<HullData>
Take ownership of owned on miss; destroy the duplicate on hit.
(b3AddOwnedHullToDatabase)
Sourcepub fn release(&mut self, hull: &Rc<HullData>)
pub fn release(&mut self, hull: &Rc<HullData>)
Drop the database’s strong ref once the last shape releases its clone.
Call while the shape still holds its Rc (strong_count >= 2 if DB also holds).
(b3RemoveHullFromDatabase)
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Trait Implementations§
Source§impl Debug for HullDatabase
impl Debug for HullDatabase
Source§impl Default for HullDatabase
impl Default for HullDatabase
Source§fn default() -> HullDatabase
fn default() -> HullDatabase
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Send for HullDatabase
impl !Sync for HullDatabase
impl Freeze for HullDatabase
impl RefUnwindSafe for HullDatabase
impl Unpin for HullDatabase
impl UnsafeUnpin for HullDatabase
impl UnwindSafe for HullDatabase
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