pub struct TypeConstraint { /* private fields */ }Implementations§
Source§impl TypeConstraint
impl TypeConstraint
pub const fn unconstrained(ty: ValueType) -> Self
pub fn with_constraint(ty: ValueType, constraint: Constraint) -> Self
pub fn dictionary(dictionary_id: DictionaryId, id_type: ValueType) -> Self
pub fn sumtype(id: SumTypeId) -> Self
pub fn get_type(&self) -> ValueType
pub fn storage_type(&self) -> ValueType
pub fn constraint(&self) -> &Option<Constraint>
pub fn to_ffi(&self) -> FFITypeConstraint
pub fn from_ffi(ffi: FFITypeConstraint) -> Self
pub fn validate(&self, value: &Value) -> Result<(), Error>
pub fn is_unconstrained(&self) -> bool
pub fn to_string(&self) -> String
Trait Implementations§
Source§impl Clone for TypeConstraint
impl Clone for TypeConstraint
Source§fn clone(&self) -> TypeConstraint
fn clone(&self) -> TypeConstraint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TypeConstraint
impl Debug for TypeConstraint
Source§impl<'de> Deserialize<'de> for TypeConstraint
impl<'de> Deserialize<'de> for TypeConstraint
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
impl Eq for TypeConstraint
Source§impl PartialEq for TypeConstraint
impl PartialEq for TypeConstraint
Source§fn eq(&self, other: &TypeConstraint) -> bool
fn eq(&self, other: &TypeConstraint) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TypeConstraint
impl Serialize for TypeConstraint
impl StructuralPartialEq for TypeConstraint
Auto Trait Implementations§
impl Freeze for TypeConstraint
impl RefUnwindSafe for TypeConstraint
impl Send for TypeConstraint
impl Sync for TypeConstraint
impl Unpin for TypeConstraint
impl UnsafeUnpin for TypeConstraint
impl UnwindSafe for TypeConstraint
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