pub struct PeerPlane { /* private fields */ }Expand description
Everything a mint or a redeem needs, and nothing a running task leaves behind.
Always built, declared or not — the same shape crate::resource_plane::ResourcePlane has,
and for the same reason: an undeclared capsule still has to record the redeem it refused, and
a plane that does not exist has nowhere to write.
Implementations§
Source§impl PeerPlane
impl PeerPlane
Sourcepub fn new(
accessible_workdir: &Path,
export: Option<(&PeerFilesExport, Arc<PeerMintKey>)>,
session_id: String,
containment_achieved: ContainmentClass,
generation: Arc<AtomicU64>,
trace: Option<Arc<ResourceTraceAppender>>,
) -> Self
pub fn new( accessible_workdir: &Path, export: Option<(&PeerFilesExport, Arc<PeerMintKey>)>, session_id: String, containment_achieved: ContainmentClass, generation: Arc<AtomicU64>, trace: Option<Arc<ResourceTraceAppender>>, ) -> Self
Everything a plane needs, and the complete list of it: a host path, the declared
export (None = undeclared = deny) paired with the instance key, the session id, the
achieved class, the generation counter and somewhere to write the record.
Sourcepub fn is_declared(&self) -> bool
pub fn is_declared(&self) -> bool
Whether this capsule declared exports.peer_files at all.
pub fn generation(&self) -> u64
Sourcepub fn mint_handle(
&self,
relpath: &str,
audience: &str,
ttl_secs: Option<u64>,
) -> Result<MintedHandle, PeerError>
pub fn mint_handle( &self, relpath: &str, audience: &str, ttl_secs: Option<u64>, ) -> Result<MintedHandle, PeerError>
Mints a handle for one file under exports.peer_files.root, for one audience.
relpath is relative to the export root and is resolved by the same code that resolves a
read, so a path that escapes — .., absolute, percent-encoded, or a symlink leaving the
root — fails the mint. It is refused, never normalised into something mintable.
ttl_secs may only narrow: a value above the declared max_ttl is clamped down, never up,
and None means the declared max_ttl.
Auto Trait Implementations§
impl Forget for PeerPlane
impl Freeze for PeerPlane
impl Move for PeerPlane
impl RefUnwindSafe for PeerPlane
impl Send for PeerPlane
impl Sync for PeerPlane
impl Unpin for PeerPlane
impl UnsafeUnpin for PeerPlane
impl UnwindSafe for PeerPlane
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