pub struct GraphTypeDef {
pub name: DbString,
pub node_types: Vec<NodeTypeDef>,
pub edge_types: Vec<EdgeTypeDef>,
}Expand description
Definition of a closed graph type per ISO clause 18.
Fields§
§name: DbStringGraph type name.
node_types: Vec<NodeTypeDef>Node-type elements in graph-type order.
edge_types: Vec<EdgeTypeDef>Edge-type elements in graph-type order.
Implementations§
Source§impl GraphTypeDef
impl GraphTypeDef
Sourcepub fn validate(self) -> GraphResult<Self>
pub fn validate(self) -> GraphResult<Self>
Validate this graph type’s structural invariants.
§Errors
Returns GraphError::Inconsistent when the type contains duplicate
names, invalid edge endpoint indexes, duplicate properties within a
node/edge type, duplicate edge triples, or an empty node label set.
Sourcepub fn find_node_type(&self, labels: &LabelSet) -> Option<&NodeTypeDef>
pub fn find_node_type(&self, labels: &LabelSet) -> Option<&NodeTypeDef>
Return the first node type matching labels.
Sourcepub fn find_node_type_index(&self, labels: &LabelSet) -> Option<u32>
pub fn find_node_type_index(&self, labels: &LabelSet) -> Option<u32>
Return the first node-type index matching labels.
Sourcepub fn node_type_index_for(&self, name: DbString) -> Option<u32>
pub fn node_type_index_for(&self, name: DbString) -> Option<u32>
Return the node-type index matching name.
Sourcepub fn find_edge_type(
&self,
label: DbString,
source_node_type: u32,
target_node_type: u32,
) -> Option<&EdgeTypeDef>
pub fn find_edge_type( &self, label: DbString, source_node_type: u32, target_node_type: u32, ) -> Option<&EdgeTypeDef>
Return the edge type matching label and observed endpoint node types.
Sourcepub fn first_edge_type_with_label(
&self,
label: DbString,
) -> Option<&EdgeTypeDef>
pub fn first_edge_type_with_label( &self, label: DbString, ) -> Option<&EdgeTypeDef>
Return the first edge type carrying label.
Sourcepub fn edge_type_index_for(&self, name: DbString) -> Option<u32>
pub fn edge_type_index_for(&self, name: DbString) -> Option<u32>
Return the edge-type index matching name.
Sourcepub fn without_node_type(&self, name: DbString) -> Option<Self>
pub fn without_node_type(&self, name: DbString) -> Option<Self>
Return a copy with the named node type removed.
Edge endpoint indexes are intentionally not rewritten. Callers that cannot tolerate positional drift must reject the drop before using this helper.
Sourcepub fn without_edge_type(&self, name: DbString) -> Option<Self>
pub fn without_edge_type(&self, name: DbString) -> Option<Self>
Return a copy with the named edge type removed.
Sourcepub fn validate_ref(&self) -> GraphResult<()>
pub fn validate_ref(&self) -> GraphResult<()>
Validate the type without consuming it.
Same checks as GraphTypeDef::validate; preferred when callers
already hold a reference (recovery, crate::SharedGraph::from_graph
re-validation) and cannot move the value.
Trait Implementations§
Source§impl Archive for GraphTypeDef
impl Archive for GraphTypeDef
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§type Archived = ArchivedGraphTypeDef
type Archived = ArchivedGraphTypeDef
Source§type Resolver = GraphTypeDefResolver
type Resolver = GraphTypeDefResolver
Source§impl Clone for GraphTypeDef
impl Clone for GraphTypeDef
Source§fn clone(&self) -> GraphTypeDef
fn clone(&self) -> GraphTypeDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GraphTypeDef
impl Debug for GraphTypeDef
Source§impl<'de> Deserialize<'de> for GraphTypeDef
impl<'de> Deserialize<'de> for GraphTypeDef
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>,
Source§impl<__D: Fallible + ?Sized> Deserialize<GraphTypeDef, __D> for Archived<GraphTypeDef>where
DbString: Archive,
<DbString as Archive>::Archived: Deserialize<DbString, __D>,
Vec<NodeTypeDef>: Archive,
<Vec<NodeTypeDef> as Archive>::Archived: Deserialize<Vec<NodeTypeDef>, __D>,
Vec<EdgeTypeDef>: Archive,
<Vec<EdgeTypeDef> as Archive>::Archived: Deserialize<Vec<EdgeTypeDef>, __D>,
impl<__D: Fallible + ?Sized> Deserialize<GraphTypeDef, __D> for Archived<GraphTypeDef>where
DbString: Archive,
<DbString as Archive>::Archived: Deserialize<DbString, __D>,
Vec<NodeTypeDef>: Archive,
<Vec<NodeTypeDef> as Archive>::Archived: Deserialize<Vec<NodeTypeDef>, __D>,
Vec<EdgeTypeDef>: Archive,
<Vec<EdgeTypeDef> as Archive>::Archived: Deserialize<Vec<EdgeTypeDef>, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<GraphTypeDef, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<GraphTypeDef, <__D as Fallible>::Error>
Source§impl PartialEq for GraphTypeDef
impl PartialEq for GraphTypeDef
Source§fn eq(&self, other: &GraphTypeDef) -> bool
fn eq(&self, other: &GraphTypeDef) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for GraphTypeDef
impl Serialize for GraphTypeDef
impl StructuralPartialEq for GraphTypeDef
Auto Trait Implementations§
impl Freeze for GraphTypeDef
impl RefUnwindSafe for GraphTypeDef
impl Send for GraphTypeDef
impl Sync for GraphTypeDef
impl Unpin for GraphTypeDef
impl UnsafeUnpin for GraphTypeDef
impl UnwindSafe for GraphTypeDef
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.