pub struct RunSection {
pub status: RunStatus,
pub reason: Option<String>,
pub action: Option<String>,
}Expand description
Optional [run] section carrying strategy execution outcome.
statusis REQUIRED when the section is present.reason/actionare OPTIONAL free-form strings; when absent they are omitted from the serialized TOML entirely (skip_serializing_if).
Used only for input validation at the Lua bridge boundary — the actual
Card TOML is written via the raw serde_json::Value path so that other
top-level fields are preserved verbatim.
Fields§
§status: RunStatus§reason: Option<String>§action: Option<String>Implementations§
Source§impl RunSection
impl RunSection
Sourcepub fn from_json(input: &Json) -> Result<Option<RunSection>, String>
pub fn from_json(input: &Json) -> Result<Option<RunSection>, String>
Extract and validate the top-level run field from a Card input JSON.
Returns:
Ok(None)whenrunis absent (the Card carries no[run]section);Ok(Some(section))whenrunis a valid[run]table;Err(msg)whenrunis present but malformed — the error message always lists the accepted status tokens (succeeded, failed, skipped) so Lua callers get an actionable diagnostic.
Trait Implementations§
Source§impl Clone for RunSection
impl Clone for RunSection
Source§fn clone(&self) -> RunSection
fn clone(&self) -> RunSection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RunSection
impl Debug for RunSection
Source§impl<'de> Deserialize<'de> for RunSection
impl<'de> Deserialize<'de> for RunSection
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
Source§impl PartialEq for RunSection
impl PartialEq for RunSection
Source§impl Serialize for RunSection
impl Serialize for RunSection
impl StructuralPartialEq for RunSection
Auto Trait Implementations§
impl Freeze for RunSection
impl RefUnwindSafe for RunSection
impl Send for RunSection
impl Sync for RunSection
impl Unpin for RunSection
impl UnsafeUnpin for RunSection
impl UnwindSafe for RunSection
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,
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>
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 moreimpl<T> MaybeSend for Twhere
T: Send,
impl<T> Scalar for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.