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 new(name: impl Into<String>) -> StateSchema
pub fn new(name: impl Into<String>) -> StateSchema
Create a new state schema
Sourcepub fn add_field(self, field: StateField) -> StateSchema
pub fn add_field(self, field: StateField) -> StateSchema
Add a field to the schema
Sourcepub fn field(
self,
name: impl Into<String>,
type_name: impl Into<String>,
) -> StateSchema
pub fn field( self, name: impl Into<String>, type_name: impl Into<String>, ) -> StateSchema
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<StateSchema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StateSchema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for StateSchema
impl Serialize for StateSchema
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 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
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> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage