pub struct Hybrid<T> { /* private fields */ }Expand description
A hybrid property wrapper.
Hybrid<T> holds a Rust-computed value of type T and is treated as a
computed field by the ORM (excluded from INSERT/UPDATE, initialized via
Default on load). The macro generates a companion _expr() method
that returns the SQL expression equivalent.
Hybrid<T> dereferences to T for ergonomic access.
Implementations§
Trait Implementations§
Source§impl<'de, T: Deserialize<'de>> Deserialize<'de> for Hybrid<T>
impl<'de, T: Deserialize<'de>> Deserialize<'de> for Hybrid<T>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl<T: Eq> Eq for Hybrid<T>
impl<T> StructuralPartialEq for Hybrid<T>
Auto Trait Implementations§
impl<T> Freeze for Hybrid<T>where
T: Freeze,
impl<T> RefUnwindSafe for Hybrid<T>where
T: RefUnwindSafe,
impl<T> Send for Hybrid<T>where
T: Send,
impl<T> Sync for Hybrid<T>where
T: Sync,
impl<T> Unpin for Hybrid<T>where
T: Unpin,
impl<T> UnwindSafe for Hybrid<T>where
T: 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
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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).
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> ModelDump for Twhere
T: Serialize,
impl<T> ModelDump for Twhere
T: Serialize,
Source§fn model_dump(&self, options: DumpOptions) -> Result<Value, Error>
fn model_dump(&self, options: DumpOptions) -> Result<Value, Error>
Serialize a model to a JSON value. Read more
Source§fn model_dump_json(&self) -> Result<String, Error>
fn model_dump_json(&self) -> Result<String, Error>
Serialize a model to a JSON string with default options.
Source§fn model_dump_json_pretty(&self) -> Result<String, Error>
fn model_dump_json_pretty(&self) -> Result<String, Error>
Serialize a model to a pretty-printed JSON string.
Source§fn model_dump_json_with_options(
&self,
options: DumpOptions,
) -> Result<String, Error>
fn model_dump_json_with_options( &self, options: DumpOptions, ) -> Result<String, Error>
Serialize a model to a JSON string with full options support. Read more
Source§impl<T> ModelValidate for Twhere
T: DeserializeOwned,
impl<T> ModelValidate for Twhere
T: DeserializeOwned,
Source§fn model_validate(
input: impl Into<ValidateInput>,
options: ValidateOptions,
) -> Result<T, ValidationError>
fn model_validate( input: impl Into<ValidateInput>, options: ValidateOptions, ) -> Result<T, ValidationError>
Create and validate a model from input. Read more
Source§fn model_validate_json(json: &str) -> ValidateResult<Self>
fn model_validate_json(json: &str) -> ValidateResult<Self>
Create and validate a model from JSON string with default options.
Source§fn model_validate_dict(dict: HashMap<String, Value>) -> ValidateResult<Self>
fn model_validate_dict(dict: HashMap<String, Value>) -> ValidateResult<Self>
Create and validate a model from a HashMap with default options.