#[non_exhaustive]pub struct PropertyDecl {
pub name: SmolStr,
pub ty: PropertyType,
pub required: bool,
}Expand description
A declared property on a label or relationship type.
Marked #[non_exhaustive] (cy-2i9.1) so new fields (e.g.
documentation, default) can land without forcing a SemVer-major
release. External crates construct via PropertyDecl::new.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: SmolStrProperty name as it appears in n.prop expressions.
ty: PropertyTypeDeclared type (spec §8.2). Consumers that don’t care about
typing can surface PropertyType::Any.
required: booltrue when the schema requires every instance to carry this
property (nullable otherwise).
Implementations§
Source§impl PropertyDecl
impl PropertyDecl
Sourcepub fn new(name: impl Into<SmolStr>, ty: PropertyType, required: bool) -> Self
pub fn new(name: impl Into<SmolStr>, ty: PropertyType, required: bool) -> Self
Construct a PropertyDecl.
This is the SemVer-stable constructor; external crates should prefer it over struct literals so the struct can grow fields without forcing a SemVer-major release.
Trait Implementations§
Source§impl Clone for PropertyDecl
impl Clone for PropertyDecl
Source§fn clone(&self) -> PropertyDecl
fn clone(&self) -> PropertyDecl
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 PropertyDecl
impl Debug for PropertyDecl
Source§impl<'de> Deserialize<'de> for PropertyDecl
impl<'de> Deserialize<'de> for PropertyDecl
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 PartialEq for PropertyDecl
impl PartialEq for PropertyDecl
Source§fn eq(&self, other: &PropertyDecl) -> bool
fn eq(&self, other: &PropertyDecl) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PropertyDecl
impl Serialize for PropertyDecl
impl Eq for PropertyDecl
impl StructuralPartialEq for PropertyDecl
Auto Trait Implementations§
impl Freeze for PropertyDecl
impl RefUnwindSafe for PropertyDecl
impl Send for PropertyDecl
impl Sync for PropertyDecl
impl Unpin for PropertyDecl
impl UnsafeUnpin for PropertyDecl
impl UnwindSafe for PropertyDecl
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.