pub struct Snapshotter { /* private fields */ }Expand description
Atomic four-layer snapshot orchestrator.
Constructed with one LayerCapture per layer (model, cache, world,
effects, trace). Captures run concurrently on stdlib threads (not tokio:
each capture is CPU-bound by hashing/compression, not I/O-bound; threads
outperform a runtime).
use std::sync::Arc;
use pf_core::{
snapshot::{Snapshotter, LayerCapture, LayerDescriptor, LayerKind},
store::PfStore,
manifest::AgentInfo,
};
let agent = AgentInfo {
kind: "demo".into(), version: "0".into(), fingerprint: "abc".into(),
};
let snapper = Snapshotter::new(agent, model, cache, world, effects, trace);
// let cid = snapper.snapshot(&store, vec![]).unwrap();Implementations§
Source§impl Snapshotter
impl Snapshotter
Sourcepub fn new(
agent: AgentInfo,
model: Arc<dyn LayerCapture>,
cache: Arc<dyn LayerCapture>,
world: Arc<dyn LayerCapture>,
effects: Arc<dyn LayerCapture>,
trace: Arc<dyn LayerCapture>,
) -> Self
pub fn new( agent: AgentInfo, model: Arc<dyn LayerCapture>, cache: Arc<dyn LayerCapture>, world: Arc<dyn LayerCapture>, effects: Arc<dyn LayerCapture>, trace: Arc<dyn LayerCapture>, ) -> Self
Construct a snapshotter with one capture per layer.
Auto Trait Implementations§
impl Freeze for Snapshotter
impl !RefUnwindSafe for Snapshotter
impl Send for Snapshotter
impl Sync for Snapshotter
impl Unpin for Snapshotter
impl UnsafeUnpin for Snapshotter
impl !UnwindSafe for Snapshotter
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