Skip to main content

UndirectedPayloadGraph

Struct UndirectedPayloadGraph 

Source
pub struct UndirectedPayloadGraph<NodePayload, EdgePayload> { /* private fields */ }

Implementations§

Source§

impl<NodePayload, EdgePayload> UndirectedPayloadGraph<NodePayload, EdgePayload>

Source

pub fn try_from_edges( nodes: Vec<NodePayload>, edges: impl IntoIterator<Item = (EdgeEndpoints, EdgePayload)>, ) -> Result<Self>

Builds an undirected graph with arbitrary node and edge payloads.

§Errors

Returns an error for invalid compact endpoints or capacity overflow.

Source

pub fn try_from_parts( topology: UndirectedTopology, nodes: Vec<NodePayload>, edges: Vec<EdgePayload>, ) -> Result<Self>

Reattaches payload vectors to a prebuilt undirected topology.

§Errors

Returns an error when either payload count differs from the topology.

Source

pub const fn topology(&self) -> &UndirectedTopology

Source

pub fn nodes(&self) -> &[NodePayload]

Source

pub fn edges(&self) -> &[EdgePayload]

Source

pub fn node(&self, index: NodeIndex) -> Option<&NodePayload>

Source

pub fn node_mut(&mut self, index: NodeIndex) -> Option<&mut NodePayload>

Source

pub fn edge(&self, index: EdgeIndex) -> Option<&EdgePayload>

Source

pub fn edge_mut(&mut self, index: EdgeIndex) -> Option<&mut EdgePayload>

Source

pub fn into_parts( self, ) -> (UndirectedTopology, Vec<NodePayload>, Vec<EdgePayload>)

Trait Implementations§

Source§

impl<NodePayload: Clone, EdgePayload: Clone> Clone for UndirectedPayloadGraph<NodePayload, EdgePayload>

Source§

fn clone(&self) -> UndirectedPayloadGraph<NodePayload, EdgePayload>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<NodePayload: Debug, EdgePayload: Debug> Debug for UndirectedPayloadGraph<NodePayload, EdgePayload>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, NodePayload, EdgePayload> Deserialize<'de> for UndirectedPayloadGraph<NodePayload, EdgePayload>
where NodePayload: Deserialize<'de>, EdgePayload: Deserialize<'de>,

Source§

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<NodePayload: Eq, EdgePayload: Eq> Eq for UndirectedPayloadGraph<NodePayload, EdgePayload>

Source§

impl<NodePayload, EdgePayload> IndexUndirectedGraphView for UndirectedPayloadGraph<NodePayload, EdgePayload>

Source§

fn node_bound(&self) -> usize

Source§

fn edge_bound(&self) -> usize

Source§

fn node_slot(node: Self::Node) -> usize

Source§

fn edge_slot(edge: Self::Edge) -> usize

Source§

fn incident_edge_at( &self, node: Self::Node, offset: usize, ) -> Option<Self::Edge>

Source§

impl<NodePayload: PartialEq, EdgePayload: PartialEq> PartialEq for UndirectedPayloadGraph<NodePayload, EdgePayload>

Source§

fn eq(&self, other: &UndirectedPayloadGraph<NodePayload, EdgePayload>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<NodePayload, EdgePayload> Serialize for UndirectedPayloadGraph<NodePayload, EdgePayload>
where NodePayload: Serialize, EdgePayload: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<NodePayload: PartialEq, EdgePayload: PartialEq> StructuralPartialEq for UndirectedPayloadGraph<NodePayload, EdgePayload>

Source§

impl<NodePayload, EdgePayload> UndirectedGraphView for UndirectedPayloadGraph<NodePayload, EdgePayload>

Source§

type Node = NodeIndex

Source§

type Edge = EdgeIndex

Source§

fn node_count(&self) -> usize

Source§

fn edge_count(&self) -> usize

Source§

fn contains_node(&self, node: Self::Node) -> bool

Source§

fn contains_edge(&self, edge: Self::Edge) -> bool

Source§

fn node_indices(&self) -> impl Iterator<Item = Self::Node> + '_

Source§

fn edge_indices(&self) -> impl Iterator<Item = Self::Edge> + '_

Source§

fn edge_endpoints(&self, edge: Self::Edge) -> Option<EdgeEndpoints<Self::Node>>

Source§

fn incident_edges( &self, node: Self::Node, ) -> impl DoubleEndedIterator<Item = Self::Edge> + ExactSizeIterator + '_

Source§

fn opposite(&self, edge: Self::Edge, node: Self::Node) -> Option<Self::Node>

Auto Trait Implementations§

§

impl<NodePayload, EdgePayload> Freeze for UndirectedPayloadGraph<NodePayload, EdgePayload>

§

impl<NodePayload, EdgePayload> RefUnwindSafe for UndirectedPayloadGraph<NodePayload, EdgePayload>
where NodePayload: RefUnwindSafe, EdgePayload: RefUnwindSafe,

§

impl<NodePayload, EdgePayload> Send for UndirectedPayloadGraph<NodePayload, EdgePayload>
where NodePayload: Send, EdgePayload: Send,

§

impl<NodePayload, EdgePayload> Sync for UndirectedPayloadGraph<NodePayload, EdgePayload>
where NodePayload: Sync, EdgePayload: Sync,

§

impl<NodePayload, EdgePayload> Unpin for UndirectedPayloadGraph<NodePayload, EdgePayload>
where NodePayload: Unpin, EdgePayload: Unpin,

§

impl<NodePayload, EdgePayload> UnsafeUnpin for UndirectedPayloadGraph<NodePayload, EdgePayload>

§

impl<NodePayload, EdgePayload> UnwindSafe for UndirectedPayloadGraph<NodePayload, EdgePayload>
where NodePayload: UnwindSafe, EdgePayload: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.