pub struct Manifest {
pub name: String,
pub version: String,
pub image_id: ImageId,
pub profile: ManifestProfile,
pub containers: Vec<ContainerGrant>,
pub workspace: WorkspaceMode,
pub max_body_bytes: u64,
pub limits: ManifestLimits,
}Expand description
An application manifest, in the shape an administrator approves.
Deserialising refuses unknown members and malformed values, but does not
check the cross-member rules or the ceilings; use ValidManifest::parse
on anything received. Serialising writes the members in this order.
§Examples
use stratum_node_core::{JobCeilings, ValidManifest};
let json = format!(
r#"{{"name":"report","version":"1.0.0","image_id":"sha256:{}","profile":"job",
"containers":[{{"path":"reports-input/","modes":["Read"],"operations":["GET"]}},
{{"path":"reports/","modes":["Read","Write"],"operations":["GET","HEAD","PUT"]}}],
"workspace":"none","max_body_bytes":65536,"limits":{{"timeout_secs":300}}}}"#,
"ab".repeat(32)
);
let valid = ValidManifest::parse(json.as_bytes(), &JobCeilings::DEFAULT)?;
assert_eq!(valid.limits().timeout_secs, 300);
assert_eq!(valid.limits().pids, 128);
assert_eq!(valid.manifest().containers.len(), 2);Fields§
§name: StringThe application’s name; a label only.
version: StringThe application’s version; a label only. A new version is a new application.
image_id: ImageIdThe image the runner starts.
profile: ManifestProfileThe job profile, always ManifestProfile::Job.
containers: Vec<ContainerGrant>One to eight granted containers.
workspace: WorkspaceModeThe most workspace the application may be given.
max_body_bytes: u64The largest request body the application may send, in bytes; the
proxy applies the smaller of this and limits.max_pod_body_bytes.
limits: ManifestLimitsThe limits; absent members take their defaults.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Manifest
impl<'de> Deserialize<'de> for Manifest
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Manifest
impl StructuralPartialEq for Manifest
Auto Trait Implementations§
impl Forget for Manifest
impl Freeze for Manifest
impl Move for Manifest
impl RefUnwindSafe for Manifest
impl Send for Manifestwhere
RawVecInner: Send,
impl Sync for Manifestwhere
RawVecInner: Sync,
impl Unpin for Manifest
impl UnsafeUnpin for Manifestwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<ContainerGrant>: UnsafeUnpin,
impl UnwindSafe for Manifestwhere
RawVecInner: UnwindSafe,
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