pub struct ContextOverride {
pub file_artifacts: HashMap<String, String>,
pub preflight_script: Option<String>,
pub env_vars: HashMap<String, String>,
pub mutation_type: Option<String>,
pub created_at: Option<String>,
pub override_id: Option<String>,
pub source: Option<String>,
pub priority: Option<i32>,
}Expand description
A context override containing file artifacts, env vars, and scripts.
Fields§
§file_artifacts: HashMap<String, String>File artifacts to write (path -> content).
preflight_script: Option<String>Preflight script to execute before rollout.
env_vars: HashMap<String, String>Environment variables to set.
mutation_type: Option<String>Type of mutation (e.g., “replace”, “patch”, “append”).
created_at: Option<String>When this override was created.
override_id: Option<String>Unique override ID.
source: Option<String>Source of the override (e.g., “optimizer”, “manual”).
priority: Option<i32>Priority for ordering (higher = applied later).
Implementations§
Source§impl ContextOverride
impl ContextOverride
Sourcepub fn new() -> ContextOverride
pub fn new() -> ContextOverride
Create a new empty context override.
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Get total size in bytes.
Sourcepub fn with_file(
self,
path: impl Into<String>,
content: impl Into<String>,
) -> ContextOverride
pub fn with_file( self, path: impl Into<String>, content: impl Into<String>, ) -> ContextOverride
Add a file artifact.
Sourcepub fn with_preflight_script(self, script: impl Into<String>) -> ContextOverride
pub fn with_preflight_script(self, script: impl Into<String>) -> ContextOverride
Set the preflight script.
Sourcepub fn with_env_var(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> ContextOverride
pub fn with_env_var( self, key: impl Into<String>, value: impl Into<String>, ) -> ContextOverride
Add an environment variable.
Sourcepub fn with_id(self, id: impl Into<String>) -> ContextOverride
pub fn with_id(self, id: impl Into<String>) -> ContextOverride
Set the override ID.
Sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
Get file count.
Sourcepub fn env_var_count(&self) -> usize
pub fn env_var_count(&self) -> usize
Get env var count.
Trait Implementations§
Source§impl Clone for ContextOverride
impl Clone for ContextOverride
Source§fn clone(&self) -> ContextOverride
fn clone(&self) -> ContextOverride
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContextOverride
impl Debug for ContextOverride
Source§impl Default for ContextOverride
impl Default for ContextOverride
Source§fn default() -> ContextOverride
fn default() -> ContextOverride
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ContextOverride
impl<'de> Deserialize<'de> for ContextOverride
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContextOverride, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContextOverride, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ContextOverride
impl Serialize for ContextOverride
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ContextOverride
impl RefUnwindSafe for ContextOverride
impl Send for ContextOverride
impl Sync for ContextOverride
impl Unpin for ContextOverride
impl UnwindSafe for ContextOverride
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request