pub struct ResourcePlane { /* private fields */ }Expand description
Everything the resource plane needs to answer a request, and nothing that a running task leaves behind.
Deliberately constructible from an export declaration, a workdir path and a containment class
alone: a later reader-only launch mode must be able to build one over an existing workdir
without starting the engine, and would be correct to report generation: 0 there, since no
task has completed in that process.
Implementations§
Source§impl ResourcePlane
impl ResourcePlane
Sourcepub fn new(
accessible_workdir: &Path,
export: Option<&FileExport>,
containment_achieved: ContainmentClass,
generation: Arc<AtomicU64>,
trace: Option<Arc<ResourceTraceAppender>>,
) -> Self
pub fn new( accessible_workdir: &Path, export: Option<&FileExport>, containment_achieved: ContainmentClass, generation: Arc<AtomicU64>, trace: Option<Arc<ResourceTraceAppender>>, ) -> Self
The five inputs a plane needs, and the complete list of them: a host path, the declared
export (None = undeclared = deny), the achieved containment class, the generation
counter and somewhere to write the record. None of them is state a completed task left
behind, which is what lets a later reader-only launch mode build one over an existing
workdir without starting the engine.
Sourcepub fn with_export(
export: Option<DeclaredExport>,
containment_achieved: ContainmentClass,
generation: Arc<AtomicU64>,
trace: Option<Arc<ResourceTraceAppender>>,
) -> Self
pub fn with_export( export: Option<DeclaredExport>, containment_achieved: ContainmentClass, generation: Arc<AtomicU64>, trace: Option<Arc<ResourceTraceAppender>>, ) -> Self
Self::new with the root already resolved.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Which turn the bytes belong to: 0 until the first task in this process reaches a
terminal state, then one more per completed task.
It answers these bytes are as of turn N and nothing else. It is not an argument — no
request selects a generation, no response conflicts because the generation has moved on,
and superseded bytes are not retained. A capsule that is finished but alive and rewrites a
file two turns later simply serves the newer file; the etag is how a caller notices.
pub fn containment_achieved(&self) -> ContainmentClass
Auto Trait Implementations§
impl !RefUnwindSafe for ResourcePlane
impl !UnwindSafe for ResourcePlane
impl Forget for ResourcePlane
impl Freeze for ResourcePlane
impl Send for ResourcePlane
impl Sync for ResourcePlane
impl Unpin for ResourcePlane
impl UnsafeUnpin for ResourcePlane
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