pub enum EdgeEndpointDef {
Any,
NodeType(u32),
OneOf(Vec<u32>),
}Expand description
Edge endpoint definition.
OneOf enumerates a sorted, deduplicated set of distinct node-type indices.
Construct it via EdgeEndpointDef::one_of to enforce the structural
invariants (sorted, deduplicated, length >= 2; singleton collapses to
EdgeEndpointDef::NodeType). Direct struct construction is permitted for
rkyv/serde decode paths but is rejected by
super::GraphTypeDef::validate_ref as defense in depth.
Variants§
Any
Accept any declared node type at this endpoint.
NodeType(u32)
Require one concrete node-type index.
OneOf(Vec<u32>)
Accept any node type drawn from a sorted, deduplicated, length >= 2 set of concrete node-type indices.
Implementations§
Source§impl EdgeEndpointDef
impl EdgeEndpointDef
Sourcepub fn one_of(indices: impl IntoIterator<Item = u32>) -> Self
pub fn one_of(indices: impl IntoIterator<Item = u32>) -> Self
Construct an endpoint accepting indices, canonicalized.
The input is sorted ascending and deduplicated. A single resulting
index collapses to EdgeEndpointDef::NodeType so that Eq/Hash
and rkyv byte encoding remain stable across construction paths.
§Panics
Panics when the resulting set is empty; zero-label endpoints are a caller bug and the upstream resolver must reject them before reaching this constructor.
Sourcepub fn matches_node_type(&self, node_type: u32) -> bool
pub fn matches_node_type(&self, node_type: u32) -> bool
Return true when this endpoint accepts the observed node-type index.
Sourcepub fn overlaps(&self, other: &Self) -> bool
pub fn overlaps(&self, other: &Self) -> bool
Return true when two endpoint declarations can match a common node type.
Sourcepub const fn node_type_index(&self) -> Option<u32>
pub const fn node_type_index(&self) -> Option<u32>
Return the concrete node-type index when this endpoint resolves to exactly one node type.
Returns None for EdgeEndpointDef::Any and
EdgeEndpointDef::OneOf; callers that need to enumerate the
candidate set should match the variant explicitly.
Trait Implementations§
Source§impl Archive for EdgeEndpointDef
impl Archive for EdgeEndpointDef
Source§type Resolver = EdgeEndpointDefResolver
type Resolver = EdgeEndpointDefResolver
Source§fn resolve(
&self,
resolver: <Self as Archive>::Resolver,
out: Place<<Self as Archive>::Archived>,
)
fn resolve( &self, resolver: <Self as Archive>::Resolver, out: Place<<Self as Archive>::Archived>, )
Source§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
serialize. Read moreSource§impl Clone for EdgeEndpointDef
impl Clone for EdgeEndpointDef
Source§fn clone(&self) -> EdgeEndpointDef
fn clone(&self) -> EdgeEndpointDef
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 EdgeEndpointDef
impl Debug for EdgeEndpointDef
Source§impl<'de> Deserialize<'de> for EdgeEndpointDef
impl<'de> Deserialize<'de> for EdgeEndpointDef
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<EdgeEndpointDef, __D> for Archived<EdgeEndpointDef>
impl<__D: Fallible + ?Sized> Deserialize<EdgeEndpointDef, __D> for Archived<EdgeEndpointDef>
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<EdgeEndpointDef, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<EdgeEndpointDef, <__D as Fallible>::Error>
Source§impl Display for EdgeEndpointDef
impl Display for EdgeEndpointDef
impl Eq for EdgeEndpointDef
Source§impl Hash for EdgeEndpointDef
impl Hash for EdgeEndpointDef
Source§impl PartialEq for EdgeEndpointDef
impl PartialEq for EdgeEndpointDef
Source§fn eq(&self, other: &EdgeEndpointDef) -> bool
fn eq(&self, other: &EdgeEndpointDef) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for EdgeEndpointDef
impl Serialize for EdgeEndpointDef
impl StructuralPartialEq for EdgeEndpointDef
Auto Trait Implementations§
impl Freeze for EdgeEndpointDef
impl RefUnwindSafe for EdgeEndpointDef
impl Send for EdgeEndpointDef
impl Sync for EdgeEndpointDef
impl Unpin for EdgeEndpointDef
impl UnsafeUnpin for EdgeEndpointDef
impl UnwindSafe for EdgeEndpointDef
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.