pub struct StateSchema {
pub name: String,
pub fields: Vec<StateField>,
pub version: String,
}Expand description
State schema for validation and documentation
Describes the structure of a graph’s state, including key names, types, and reducer configurations.
Fields§
§name: StringSchema name
fields: Vec<StateField>Field definitions
version: StringSchema version
Implementations§
Source§impl StateSchema
impl StateSchema
Sourcepub fn add_field(self, field: StateField) -> Self
pub fn add_field(self, field: StateField) -> Self
Add a field to the schema
Sourcepub fn field(
self,
name: impl Into<String>,
type_name: impl Into<String>,
) -> Self
pub fn field( self, name: impl Into<String>, type_name: impl Into<String>, ) -> Self
Add a simple field
Sourcepub fn get_field(&self, name: &str) -> Option<&StateField>
pub fn get_field(&self, name: &str) -> Option<&StateField>
Get a field by name
Sourcepub fn field_names(&self) -> Vec<&str>
pub fn field_names(&self) -> Vec<&str>
Get all field names
Trait Implementations§
Source§impl Clone for StateSchema
impl Clone for StateSchema
Source§fn clone(&self) -> StateSchema
fn clone(&self) -> StateSchema
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 StateSchema
impl Debug for StateSchema
Source§impl<'de> Deserialize<'de> for StateSchema
impl<'de> Deserialize<'de> for StateSchema
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
Auto Trait Implementations§
impl Freeze for StateSchema
impl RefUnwindSafe for StateSchema
impl Send for StateSchema
impl Sync for StateSchema
impl Unpin for StateSchema
impl UnsafeUnpin for StateSchema
impl UnwindSafe for StateSchema
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