Field

Struct Field 

Source
pub struct Field<T> {
    pub meta: DataType,
    pub name: FNameStr,
    pub value: T,
}

Fields§

§meta: DataType§name: FNameStr§value: T

Implementations§

Source§

impl<T> Field<T>

Source

pub fn new<S: Into<FNameStr>, V: Into<T>>( meta: DataType, name: S, value: V, ) -> Self

Source

pub fn new_opt(meta: DataType, name: Option<FNameStr>, value: T) -> Self

Source

pub fn get_name(&self) -> &str

Source

pub fn clone_name(&self) -> String

Source

pub fn get_meta(&self) -> &DataType

Source

pub fn set_name<S: Into<FNameStr>>(&mut self, name: S)

Source§

impl Field<Value>

Source

pub fn from_shared_chars<S: Into<FNameStr>>(name: S, val: FValueStr) -> Self

Source

pub fn get_chars(&self) -> Option<&str>

Source

pub fn get_chars_mut(&mut self) -> Option<&mut FValueStr>

Source§

impl<T> Field<T>
where T: AsValueRef<Value>,

Source

pub fn get_value(&self) -> &Value

Source

pub fn get_value_mut(&mut self) -> &mut Value

Source§

impl<T> Field<T>
where T: Maker<bool>,

Source

pub fn from_bool<S: Into<FNameStr>>(name: S, val: bool) -> Self

Source§

impl<T> Field<T>
where T: Maker<FValueStr>,

Source

pub fn from_chars<N: Into<FNameStr>, V: Into<FValueStr>>( name: N, val: V, ) -> Self

Source§

impl<T> Field<T>
where T: Maker<Value>,

Source

pub fn from_symbol<N: Into<FNameStr>, V: Into<SmolStr>>(name: N, val: V) -> Self

Source§

impl<T> Field<T>
where T: Maker<i64>,

Source

pub fn from_digit<S: Into<FNameStr>>(name: S, val: i64) -> Self

Source§

impl<T> Field<T>
where T: Maker<HexT>,

Source

pub fn from_hex<S: Into<FNameStr>>(name: S, val: HexT) -> Self

Source§

impl<T> Field<T>
where T: Maker<f64>,

Source

pub fn from_float<S: Into<FNameStr>>(name: S, val: f64) -> Self

Source§

impl<T> Field<T>
where T: Maker<IpAddr>,

Source

pub fn from_ip<S: Into<FNameStr>>(name: S, ip: IpAddr) -> Self

Source§

impl<T> Field<T>
where T: Maker<DomainT>,

Source

pub fn from_domain<S: Into<FNameStr>, V: Into<SmolStr>>( name: S, domain: V, ) -> Self

Source§

impl<T> Field<T>
where T: Maker<UrlValue>,

Source

pub fn from_url<S: Into<FNameStr>, V: Into<SmolStr>>(name: S, url: V) -> Self

Source§

impl<T> Field<T>
where T: Maker<EmailT>,

Source

pub fn from_email<S: Into<FNameStr>, V: Into<SmolStr>>( name: S, email: V, ) -> Self

Source§

impl<T> Field<T>
where T: Maker<IdCardT>,

Source

pub fn from_id_card<S: Into<FNameStr>, V: Into<SmolStr>>( name: S, id_card: V, ) -> Self

Source§

impl<T> Field<T>
where T: Maker<MobilePhoneT>,

Source

pub fn from_mobile_phone<S: Into<FNameStr>, V: Into<SmolStr>>( name: S, mobile_phone: V, ) -> Self

Source§

impl<T> Field<T>
where T: Maker<IgnoreT>,

Source

pub fn from_ignore<S: Into<FNameStr>>(name: S) -> Self

Source§

impl<T> Field<T>
where T: Maker<DateTimeValue>,

Source

pub fn from_time<S: Into<FNameStr>>(name: S, val: DateTimeValue) -> Self

Source§

impl<T> Field<T>
where T: Maker<Vec<Field<Value>>>,

Source

pub fn from_arr<S: Into<FNameStr>>(name: S, val: Vec<Field<Value>>) -> Self

Source§

impl<T> Field<T>
where T: Maker<ObjectValue>,

Source

pub fn from_obj<S: Into<FNameStr>>(name: S, val: ObjectValue) -> Self

Trait Implementations§

Source§

impl<T: Clone> Clone for Field<T>

Source§

fn clone(&self) -> Field<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Field<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, T> Deserialize<'de> for Field<T>
where T: Deserialize<'de>,

Source§

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<T> Display for Field<T>
where T: Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> From<Field<T>> for Field<Arc<T>>

Source§

fn from(other: Field<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Field<T>> for Field<Rc<T>>

Source§

fn from(other: Field<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> LevelFormatAble for Field<T>
where T: Display,

Source§

fn level_fmt(&self, f: &mut Formatter<'_>, level: usize) -> Result

Source§

impl<T: PartialEq> PartialEq for Field<T>

Source§

fn eq(&self, other: &Field<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<V> RecordItem for Field<V>
where V: AsValueRef<Value>,

Source§

fn get_name(&self) -> &str

Source§

fn get_meta(&self) -> &DataType

Source§

fn get_value(&self) -> &Value

Source§

fn get_value_mut(&mut self) -> &mut Value

Source§

impl<V> RecordItemFactory for Field<V>
where V: Maker<i64> + Maker<FValueStr> + Maker<IpAddr>,

Source§

fn from_digit<S: Into<FNameStr>>(name: S, val: i64) -> Self

Source§

fn from_ip<S: Into<FNameStr>>(name: S, ip: IpAddr) -> Self

Source§

fn from_chars<N: Into<FNameStr>, Val: Into<FValueStr>>( name: N, val: Val, ) -> Self

Source§

impl<T> Serialize for Field<T>
where T: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T> ValueRef<T> for Field<T>

Source§

fn value_ref(&self) -> &T

Returns an immutable reference to the inner value
Source§

impl<T: Eq> Eq for Field<T>

Source§

impl<T> StructuralPartialEq for Field<T>

Auto Trait Implementations§

§

impl<T> Freeze for Field<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Field<T>
where T: RefUnwindSafe,

§

impl<T> Send for Field<T>
where T: Send,

§

impl<T> Sync for Field<T>
where T: Sync,

§

impl<T> Unpin for Field<T>
where T: Unpin,

§

impl<T> UnwindSafe for Field<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,