pub struct Offload {
pub gpu: bool,
pub cpu_time_ms: u64,
pub memory_bytes: u64,
pub output_bytes: u64,
}Expand description
What an offloadable action needs of the device that runs it.
An offloadable action is a pure content transform: its inputs are content (files the invoker can read), its outputs are content, and the outputs are a function of the inputs alone, byte for byte, whichever device computes them. That is what lets the system run it on the invoker’s best-placed device: the action itself is dispatched to that device’s provider — a tilolang app or an engine alike — under the caller’s grants, and answers exactly what a local run returns. When no device is better placed, or the offload fails for any reason other than the action’s own, it runs locally.
The declaration names no package and no command line: it says what the work needs of a device, and the action runs there as itself.
Fields§
§gpu: boolWhether it needs a GPU.
Encoded always, false or not: the declaration travels inside frames of formats that carry no field names or lengths, where a field skipped when absent is read out of the next field’s bytes.
cpu_time_ms: u64§memory_bytes: u64Memory ceiling, in bytes. The inputs count against it.
output_bytes: u64Ceiling on all outputs together, in bytes.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Offload
impl<'de> Deserialize<'de> for Offload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Offload
impl StructuralPartialEq for Offload
Auto Trait Implementations§
impl Forget for Offload
impl Freeze for Offload
impl Move for Offload
impl RefUnwindSafe for Offload
impl Send for Offload
impl Sync for Offload
impl Unpin for Offload
impl UnsafeUnpin for Offload
impl UnwindSafe for Offload
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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