pub struct NativeRuntime { /* private fields */ }Expand description
Native-process runtime.
Implementations§
Source§impl NativeRuntime
impl NativeRuntime
Sourcepub fn new(cfg: NativeConfig) -> Self
pub fn new(cfg: NativeConfig) -> Self
New adapter rooted at cfg.root.
Trait Implementations§
Source§impl WorkloadRuntime for NativeRuntime
impl WorkloadRuntime for NativeRuntime
Source§fn network_exposure(&self) -> NetworkPolicy
fn network_exposure(&self) -> NetworkPolicy
A native process has the host’s network: nothing here restricts
egress yet (nftables / landlock are deferred, ADR-100 section 4),
so the gate is told egress.
Source§fn provides(&self) -> Vec<Capability>
fn provides(&self) -> Vec<Capability>
Capabilities a node advertises when this adapter works.
Source§fn admit<'life0, 'life1, 'async_trait>(
&'life0 self,
w: &'life1 VerifiedWorkload,
) -> Pin<Box<dyn Future<Output = Result<Admission, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn admit<'life0, 'life1, 'async_trait>(
&'life0 self,
w: &'life1 VerifiedWorkload,
) -> Pin<Box<dyn Future<Output = Result<Admission, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self-check: can this node run
w? Reserves nothing it cannot undo.Source§fn load<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
w: &'life1 VerifiedWorkload,
cfg: &'life2 WorkloadConfig,
) -> Pin<Box<dyn Future<Output = Result<InstanceHandle, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn load<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
w: &'life1 VerifiedWorkload,
cfg: &'life2 WorkloadConfig,
) -> Pin<Box<dyn Future<Output = Result<InstanceHandle, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Stage the payload and config; returns a handle for the instance.
Source§fn staged_payload<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Option<PathBuf>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn staged_payload<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Option<PathBuf>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The file an instance’s binary was staged to, when the adapter runs it
from disk (the licence run gate rehashes it at each start).
None:
not run from a file this node can read (a container image is tagged
by the binary’s BLAKE3; a remote device holds its own copy).Source§fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Start the instance.
Source§fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
grace: Duration,
) -> Pin<Box<dyn Future<Output = Result<RunEvidence, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
grace: Duration,
) -> Pin<Box<dyn Future<Output = Result<RunEvidence, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stop it (terminate, then kill after
grace) and return evidence.Source§fn unload<'life0, 'async_trait>(
&'life0 self,
h: InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unload<'life0, 'async_trait>(
&'life0 self,
h: InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove staged payload and state.
Source§fn status<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = InstanceStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn status<'life0, 'life1, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = InstanceStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Current status.
Source§fn control_mode(&self) -> ControlMode
fn control_mode(&self) -> ControlMode
Managed or adopted.
Source§fn console<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
command: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<RunEvidence, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn console<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
command: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<RunEvidence, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Run one console cycle (
[console] limits apply). command must be
one of the cog’s [console].allowed_commands.Source§fn link_security(&self) -> LinkSecurity
fn link_security(&self) -> LinkSecurity
How the link to a remote device is authenticated. Fails closed:
only a remote adapter with a pinned transport says
Pinned.Source§fn adopt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
_w: &'life2 VerifiedWorkload,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn adopt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
h: &'life1 InstanceHandle,
_w: &'life2 VerifiedWorkload,
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Re-attach an instance this adapter loaded before the controller
restarted (its in-memory table is gone but the device still holds
it). The adapter verifies the instance is still there and still the
pinned version, so
stop / unload work again; it starts and
changes nothing on the device.Source§fn console_preemptions<'life0, 'life1, 'async_trait>(
&'life0 self,
_h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<Vec<Preemption>, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn console_preemptions<'life0, 'life1, 'async_trait>(
&'life0 self,
_h: &'life1 InstanceHandle,
) -> Pin<Box<dyn Future<Output = Result<Vec<Preemption>, RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Instances that must stop before a console run of
h. The host
gates each one as workload.stop before calling Self::preempt.Auto Trait Implementations§
impl !Freeze for NativeRuntime
impl !RefUnwindSafe for NativeRuntime
impl !UnwindSafe for NativeRuntime
impl Send for NativeRuntime
impl Sync for NativeRuntime
impl Unpin for NativeRuntime
impl UnsafeUnpin for NativeRuntime
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
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> ⓘ
Converts
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> ⓘ
Converts
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