pub enum ExternalId {
Null,
Boolean(bool),
Integer(String),
Float(u64),
String(String),
Bytes(Vec<u8>),
Tuple(Vec<Self>),
FrozenSet(BTreeSet<Self>),
}Expand description
Lossless, deterministically ordered external graph identity.
Variants§
Null
Boolean(bool)
Integer(String)
Canonical arbitrary-precision decimal integer.
Float(u64)
Exact IEEE-754 bit representation.
String(String)
Bytes(Vec<u8>)
Tuple(Vec<Self>)
FrozenSet(BTreeSet<Self>)
Implementations§
Source§impl ExternalId
impl ExternalId
Sourcepub fn integer(value: impl Into<String>) -> Result<Self, GraphError>
pub fn integer(value: impl Into<String>) -> Result<Self, GraphError>
Construct a validated arbitrary-precision integer identity.
Sourcepub fn tuple(values: Vec<Self>) -> Result<Self, GraphError>
pub fn tuple(values: Vec<Self>) -> Result<Self, GraphError>
Construct a tuple identity and validate nesting/size limits.
Sourcepub fn frozen_set(
values: impl IntoIterator<Item = Self>,
) -> Result<Self, GraphError>
pub fn frozen_set( values: impl IntoIterator<Item = Self>, ) -> Result<Self, GraphError>
Construct a canonical frozen-set identity.
Sourcepub fn validate(&self) -> Result<(), GraphError>
pub fn validate(&self) -> Result<(), GraphError>
Validate canonical payloads and resource bounds.
Sourcepub fn to_json_bytes(&self) -> Result<Vec<u8>, GraphError>
pub fn to_json_bytes(&self) -> Result<Vec<u8>, GraphError>
Encode the canonical tagged JSON envelope used by bindings and stored tagged identity properties.
Sourcepub fn from_tagged_value(value: Value) -> Result<Self, GraphError>
pub fn from_tagged_value(value: Value) -> Result<Self, GraphError>
Decode one canonical tagged JSON envelope.
Sourcepub fn from_scalar(value: Value) -> Result<Self, GraphError>
pub fn from_scalar(value: Value) -> Result<Self, GraphError>
Convert an ordinary JSON scalar without erasing its type.
Trait Implementations§
Source§impl Clone for ExternalId
impl Clone for ExternalId
Source§fn clone(&self) -> ExternalId
fn clone(&self) -> ExternalId
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 ExternalId
impl Debug for ExternalId
Source§impl<'de> Deserialize<'de> for ExternalId
impl<'de> Deserialize<'de> for ExternalId
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 ExternalId
impl Display for ExternalId
impl Eq for ExternalId
Source§impl From<&ExternalId> for ExternalId
impl From<&ExternalId> for ExternalId
Source§fn from(value: &ExternalId) -> Self
fn from(value: &ExternalId) -> Self
Converts to this type from the input type.
Source§impl From<&String> for ExternalId
impl From<&String> for ExternalId
Source§impl From<&str> for ExternalId
impl From<&str> for ExternalId
Source§impl From<String> for ExternalId
impl From<String> for ExternalId
Source§impl From<bool> for ExternalId
impl From<bool> for ExternalId
Source§impl From<f64> for ExternalId
impl From<f64> for ExternalId
Source§impl From<i64> for ExternalId
impl From<i64> for ExternalId
Source§impl From<u64> for ExternalId
impl From<u64> for ExternalId
Source§impl Hash for ExternalId
impl Hash for ExternalId
Source§impl Ord for ExternalId
impl Ord for ExternalId
Source§fn cmp(&self, other: &ExternalId) -> Ordering
fn cmp(&self, other: &ExternalId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ExternalId
impl PartialEq for ExternalId
Source§impl PartialEq<&str> for ExternalId
impl PartialEq<&str> for ExternalId
Source§impl PartialEq<String> for ExternalId
impl PartialEq<String> for ExternalId
Source§impl PartialOrd for ExternalId
impl PartialOrd for ExternalId
Source§impl Serialize for ExternalId
impl Serialize for ExternalId
impl StructuralPartialEq for ExternalId
Auto Trait Implementations§
impl Freeze for ExternalId
impl RefUnwindSafe for ExternalId
impl Send for ExternalId
impl Sync for ExternalId
impl Unpin for ExternalId
impl UnsafeUnpin for ExternalId
impl UnwindSafe for ExternalId
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