pub struct BvhBackend { /* private fields */ }Expand description
BVH spatial backend wrapping BvhStore.
Implementations§
Source§impl BvhBackend
impl BvhBackend
Sourcepub fn new(config: BvhStoreConfig) -> Self
pub fn new(config: BvhStoreConfig) -> Self
Create from store config (no chain sink yet).
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Defaults (1M leaves).
Sourcepub fn with_sink(config: BvhStoreConfig, sink: Arc<dyn ChainSink>) -> Self
pub fn with_sink(config: BvhStoreConfig, sink: Arc<dyn ChainSink>) -> Self
Create with a chain sink attached before first mutation.
Sourcepub fn set_chain_sink(&self, sink: Arc<dyn ChainSink>)
pub fn set_chain_sink(&self, sink: Arc<dyn ChainSink>)
Attach / replace the chain sink after construction (boot order).
Sourcepub fn with_store<R>(&self, f: impl FnOnce(&mut BvhStore) -> R) -> R
pub fn with_store<R>(&self, f: impl FnOnce(&mut BvhStore) -> R) -> R
Run f with the store locked (branch-scoped insert / remove / query for the daemon’s
ecc.spatial.* RPCs). Mutations still go through the store’s chain sink.
Sourcepub fn events(&self) -> (Vec<BvhChainKind>, bool)
pub fn events(&self) -> (Vec<BvhChainKind>, bool)
Mutation events recorded so far, and whether old ones were dropped.
Sourcepub fn verify_replay(&self) -> ReplayReport
pub fn verify_replay(&self) -> ReplayReport
Rebuild a replica from the mutation log and compare it with the live store (branches and leaf ids per branch). The live store is not replaced.
Sourcepub fn snapshot_main(&self) -> Vec<(LeafId, Leaf)>
pub fn snapshot_main(&self) -> Vec<(LeafId, Leaf)>
Snapshot leaves on the main branch (restart equality tests).
Sourcepub fn restore_main(&self, leaves: &[(LeafId, Leaf)]) -> SpatialResult<()>
pub fn restore_main(&self, leaves: &[(LeafId, Leaf)]) -> SpatialResult<()>
Restore leaves on the main branch (restart helper).
Sourcepub fn branch_count(&self) -> usize
pub fn branch_count(&self) -> usize
Number of branches.
Sourcepub fn rebalance_seal(&self) -> SpatialResult<()>
pub fn rebalance_seal(&self) -> SpatialResult<()>
Seal / rebalance witness for the active branch.
Trait Implementations§
Source§impl SpatialBackend for BvhBackend
impl SpatialBackend for BvhBackend
Source§fn query_ray(&self, ray: Ray, max_t: f32) -> Vec<RayHit>
fn query_ray(&self, ray: Ray, max_t: f32) -> Vec<RayHit>
t).Source§fn query_knn(&self, p: Vec3, k: usize) -> Vec<LeafId>
fn query_knn(&self, p: Vec3, k: usize) -> Vec<LeafId>
Source§fn derive_branch(&self, meta: BranchMeta) -> SpatialResult<BranchId>
fn derive_branch(&self, meta: BranchMeta) -> SpatialResult<BranchId>
Source§fn branch_diff(&self, a: BranchId, b: BranchId, region: Aabb) -> Vec<DiffEntry>
fn branch_diff(&self, a: BranchId, b: BranchId, region: Aabb) -> Vec<DiffEntry>
region.Source§fn backend_name(&self) -> &str
fn backend_name(&self) -> &str
"bvh").Source§fn max_leaves(&self) -> Option<usize>
fn max_leaves(&self) -> Option<usize>
Source§fn insert_with_epoch(
&self,
leaf: Leaf,
parent_epoch: u64,
) -> SpatialResult<LeafId>
fn insert_with_epoch( &self, leaf: Leaf, parent_epoch: u64, ) -> SpatialResult<LeafId>
parent_epoch.Auto Trait Implementations§
impl !Freeze for BvhBackend
impl RefUnwindSafe for BvhBackend
impl Send for BvhBackend
impl Sync for BvhBackend
impl Unpin for BvhBackend
impl UnsafeUnpin for BvhBackend
impl UnwindSafe for BvhBackend
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more