pub enum FieldValue {
String(String),
Enum(String),
Markdown(String),
Number(f64),
Date(DateTime),
Objects(Vec<ObjectValues>),
Oneof((String, Box<FieldValue>)),
Boolean(bool),
File(File),
Meta(Meta),
Null,
}Variants§
String(String)
Enum(String)
Markdown(String)
Number(f64)
Date(DateTime)
Objects(Vec<ObjectValues>)
Oneof((String, Box<FieldValue>))
Boolean(bool)
File(File)
Meta(Meta)
Null
Implementations§
Source§impl FieldValue
impl FieldValue
pub fn compare(&self, to: &FieldValue) -> Option<Ordering>
pub fn typed_objects( &self, definition: &ObjectDefinition, field_config: &FieldConfig, ) -> Value
pub fn is_empty(&self) -> bool
Source§impl FieldValue
impl FieldValue
pub fn from_string( key: &String, field_type: &FieldType, value: String, ) -> Result<FieldValue, InvalidFieldError>
pub fn from_toml( key: &String, field_type: &FieldType, value: &Value, ) -> Result<FieldValue, Box<dyn Error>>
Source§impl FieldValue
impl FieldValue
pub fn to_liquid(&self, field_config: &FieldConfig) -> Value
Trait Implementations§
Source§impl Clone for FieldValue
impl Clone for FieldValue
Source§fn clone(&self) -> FieldValue
fn clone(&self) -> FieldValue
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FieldValue
impl Debug for FieldValue
Source§impl<'de> Deserialize<'de> for FieldValue
impl<'de> Deserialize<'de> for FieldValue
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 Display for FieldValue
impl Display for FieldValue
Source§impl From<&FieldValue> for Option<Value>
impl From<&FieldValue> for Option<Value>
Source§fn from(value: &FieldValue) -> Self
fn from(value: &FieldValue) -> Self
Converts to this type from the input type.
Source§impl From<&Value> for FieldValue
impl From<&Value> for FieldValue
Source§impl Hash for FieldValue
impl Hash for FieldValue
Source§impl PartialEq for FieldValue
impl PartialEq for FieldValue
Source§impl Renderable for FieldValue
impl Renderable for FieldValue
type Output = RenderedFieldValue
fn rendered(self, field_config: &FieldConfig) -> Self::Output
Source§impl Serialize for FieldValue
impl Serialize for FieldValue
Source§impl ValueView for FieldValue
impl ValueView for FieldValue
Source§fn render(&self) -> DisplayCow<'_>
fn render(&self) -> DisplayCow<'_>
A Display for a BoxedValue rendered for the user.
Source§fn source(&self) -> DisplayCow<'_>
fn source(&self) -> DisplayCow<'_>
A Display for a Value as source code.
Source§fn to_kstr(&self) -> KStringCow<'_>
fn to_kstr(&self) -> KStringCow<'_>
Interpret as a string.
Source§fn query_state(&self, state: State) -> bool
fn query_state(&self, state: State) -> bool
Query the value’s state
Source§fn as_object(&self) -> Option<&dyn ObjectView>
fn as_object(&self) -> Option<&dyn ObjectView>
Extracts the object value if it is a object.
impl StructuralPartialEq for FieldValue
Auto Trait Implementations§
impl Freeze for FieldValue
impl RefUnwindSafe for FieldValue
impl Send for FieldValue
impl Sync for FieldValue
impl Unpin for FieldValue
impl UnwindSafe for FieldValue
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.