Struct GenericGraph

Source
pub struct GenericGraph<T, A> { /* private fields */ }
Expand description

§Generic graph implementation

  • contains multiple measurable quantities

Implementations§

Source§

impl<T, A> GenericGraph<T, A>
where T: Node, A: AdjContainer<T>,

Source

pub fn new(size: usize) -> Self

Create new graph with size nodes and no edges

Source§

impl<T, A> GenericGraph<T, A>
where A: AdjContainer<T>,

Source

pub fn clear_edges(&mut self)

§removes all edges from the graph
  • inexpensive O(1), if there are no edges to begin with
  • O(vertices) otherwise
Source

pub fn sort_adj(&mut self)

§Sort adjecency lists

If you depend on the order of the adjecency lists, you can sort them

§Performance
  • internally uses pattern-defeating quicksort as long as that is the standard
  • sorts an adjecency list with length d in worst-case: O(d log(d))
  • is called for each adjecency list, i.e., self.vertex_count() times
Source

pub fn container(&self, index: usize) -> &A

§get AdjContainer of vertex index
  • panics if index out of bounds
Source

pub fn container_checked(&self, index: usize) -> Option<&A>

§get AdjContainer of vertex index
  • None if index is out of bounds
  • Some(&A) else
Source

pub fn container_iter(&self) -> Iter<'_, A>

  • get iterator over AdjContainer in order of the indices
  • iterator returns AdjContainer<Node>
Source

pub fn container_iter_neighbors(&self, index: usize) -> NContainerIter<'_, T, A>

  • iterate over AdjContainer of neighbors of vertex index

  • iterator returns AdjContainer<Node>

  • sort_adj will affect the order

    If let mut iter = self.contained_iter_neighbors() is called directly after self.sort_adj(), the following will be true (as long as iter does not return None of cause): iter.next().unwrap().id() < iter.next().unwrap.id() < ... Note, that ...id() returns the index of the corresponding vertex

  • panics if index out of bounds

Source

pub fn contained_iter(&self) -> ContainedIter<'_, T, A>

  • get iterator over additional information stored at each vertex in order of the indices
  • iterator returns a Node (for example EmptyNode or whatever you used)
  • similar to self.container_iter().map(|container| container.contained())
Source

pub fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, A>

  • same as contained_iter, but mutable
Source

pub fn contained_iter_neighbors(&self, index: usize) -> NContainedIter<'_, T, A>

  • iterate over additional information of neighbors of vertex index
  • iterator returns &T
  • sort_adj will affect the order
  • panics if index out of bounds
Source

pub fn contained_iter_neighbors_with_index( &self, index: usize, ) -> NIContainedIter<'_, T, A>

  • iterate over additional information of neighbors of vertex index
  • iterator returns (index_neighbor,&T)
  • sort_adj will affect the order
  • panics if index out of bounds
Source

pub fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, A>

  • iterate over mutable additional information of neighbors of vertex index
  • iterator returns &mut T
  • sort_adj will affect the order
  • panics if index out of bounds
  • See also: GraphIteratorsMut
Source

pub fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, A>

  • iterate over mutable additional information of neighbors of vertex index
  • iterator returns (index_neighbor: usize, neighbor: &mut T)
  • sort_adj will affect the order
  • panics if index out of bounds
  • See also: GraphIteratorsMut
Source

pub fn at(&self, index: usize) -> &T

§For your calculations etc.
  • read access to your struct T, stored at each vertex, that implements Node trait
§Note
  • panics if index out of bounds
Source

pub fn at_checked(&self, index: usize) -> Option<&T>

§For your calculations etc.
  • read access to your struct T, stored at each vertex, that implements Node trait
  • None if index is out of bounds
Source

pub fn at_mut(&mut self, index: usize) -> &mut T

§For your calculations etc.
  • write access to your struct T, stored at each vertex, that implements Node trait
§Note
  • panics if index out of bounds
Source

pub fn vertex_count(&self) -> usize

returns number of vertices present in graph

Source

pub fn average_degree(&self) -> f32

calculates the average degree of the graph

  • (2 * edge_count) / vertex_count
Source

pub fn get_contained(&self, index: usize) -> Option<&T>

Returns a reference to the element stored in the specified node or None if out of Bounds

Source

pub fn get_contained_mut(&mut self, index: usize) -> Option<&mut T>

Returns a mutable reference to the element stored in the specified node or None if out of Bounds

Source

pub unsafe fn get_contained_unchecked(&self, index: usize) -> &T

Returns a reference to the element stored in the specified node

For a save alternative see get_contained

§Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.

Source

pub unsafe fn get_contained_unchecked_mut(&mut self, index: usize) -> &mut T

Returns a mutable reference to the element stored in the specified node

For a save alternative see get_contained_mut

§Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.

Source

pub fn add_edge( &mut self, index1: usize, index2: usize, ) -> Result<(), GraphErrors>

Adds edge between nodes index1 and index2

§ErrorCases:
ErrorReason
GraphErrors::IndexOutOfRangeindex1 or index2 larger than self.vertex_count()
GraphErrors::EdgeExistsrequested edge already exists!
§panics
  • if indices out of bounds
  • in debug: If index0 == index1
Source

pub fn remove_edge( &mut self, index1: usize, index2: usize, ) -> Result<(), GraphErrors>

Removes edge between nodes index1 and index2

§ErrorCases:
ErrorReason
GraphErrors::IndexOutOfRangeindex1 or index2 larger than self.vertex_count()
GraphErrors::EdgeDoesNotExistrequested edge does not exists
§panics
  • if index out of bounds
  • in debug: If index0 == index1
Source

pub fn edge_count(&self) -> usize

returns total number of edges in graph

Source

pub fn degree(&self, index: usize) -> Option<usize>

  • returns number of vertices adjacent to vertex index
  • None if index out of bounds
Source

pub fn degree_vec(&self) -> Vec<usize>

§get degree vector
  • returns vector of length self.vertex_count() where each entry corresponds to the degree of the vertex with the respective index
Source

pub fn dfs(&self, index: usize) -> Dfs<'_, T, A>

§returns Iterator
  • the iterator will iterate over the vertices in depth first search order, beginning with vertex index.
  • iterator returns node
  • iterator always returns None if index out of bounds
§Order

Order is guaranteed to be in DFS order, however if this order is not unambigouse adding edges and especially removing edges will shuffle the order.

§Note:

Will only iterate over vertices within the connected component that contains vertex index

Source

pub fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, A>

§returns Iterator
  • the iterator will iterate over the vertices in depth first search order, beginning with vertex index.
  • Iterator returns tuple (index, node)
  • iterator always returns None if index out of bounds
§Order

Order is guaranteed to be in DFS order, however if this order is not unambigouse adding edges and especially removing edges will shuffle the order.

§Note:

Will only iterate over vertices within the connected component that contains vertex index

Source

pub fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, A>

§returns Iterator
  • the iterator will iterate over the vertices in breadth first search order, beginning with vertex index.
  • Iterator returns tuple (index, node, depth)
§depth
  • starts at 0 (i.e. the first element in the iterator will have depth = 0)
  • depth equals number of edges in the shortest path from the current vertex to the first vertex (i.e. to the vertex with index index)
§Order

Order is guaranteed to be in BFS order, however if this order is not unambigouse adding edges and especially removing edges will shuffle the order.

§Note:

Will only iterate over vertices within the connected component that contains vertex index

Source

pub fn bfs_filtered<'a, 'b, F>( &'a self, index: usize, filter: &'b mut F, ) -> Option<BfsFiltered<'a, 'b, T, A, F>>
where F: 'b + FnMut(&T, usize) -> bool,

  • similar to self.bfs_index_depth, but allows for ignoring of vertices

  • the iterator will iterate over the vertices in breadth first search order, beginning with vertex index.

  • the iterator will ignore all vertices, where filter(vertex, index_of_vertex) returns false

  • returns Noneif index is out of bounds or filter(vertex, index)retruns false

  • Iterator returns tuple (index, vertex, depth)

§depth
  • starts at 0 (i.e. the first element in the iterator will have depth = 0)
  • depth equals number of edges in the shortest path from the current vertex to the first vertex (i.e. to the vertex with index index), while ignoring paths that go through filtered out vertices
§Order

Order is guaranteed to be in BFS order, however if this order is not unambigouse adding edges and especially removing edges will shuffle the order.

§Note:

Will only iterate over vertices within the connected component that contains vertex index

Source

pub fn is_connected(&self) -> Option<bool>

resultcondition
Noneif graph does not contain any vertices
Some(true)else if all vertices are connected by paths of edges
Some(false)otherwise
Source

pub fn q_core(&self, q: usize) -> Option<usize>

§definition

Calculates the size of the q-core (i.e. number of nodes in the biggest possible set of nodes, where all nodes from the set are connected with at least q other nodes from the set)

returns None if impossible to calculate (e.g. vertex_count == 0 or q <= 1)

§Example
use net_ensembles::EmptyNode;
use net_ensembles::Graph;

let graph: Graph<EmptyNode> = Graph::new(0);
assert_eq!(graph.q_core(1), None);
assert_eq!(graph.q_core(2), None);

let graph2: Graph<EmptyNode> = Graph::new(1);

assert_eq!(graph2.q_core(1), None);
assert_eq!(graph2.q_core(2), Some(0));


// create complete graph
let mut graph3: Graph<EmptyNode> = Graph::new(20);
for i in 0..graph3.vertex_count() {
    for j in i+1..graph3.vertex_count() {
        graph3.add_edge(i, j).unwrap();
    }
}

// since this is a complete graph, the q-core should always consist of 20 nodes
// as long as q < 20, as every node has 19 neighbors
for i in 2..20 {
    assert_eq!(graph3.q_core(i), Some(20));
}

assert_eq!(graph3.q_core(20), Some(0));
Source

pub fn connected_components_ids(&self) -> (usize, Vec<isize>)

§compute connected component ids
  • used for self.connected_components()
  • each vertex gets an id, all vertices with the same id are in the same connected component
  • returns (number of components, vector of ids)
Source

pub fn connected_components(&self) -> Vec<usize>

§compute sizes of all connected components
  • the number of connected components is the size of the returned vector, i.e. result.len()
  • returns empty vector, if graph does not contain vertices
  • returns (reverse) ordered vector of sizes of the connected components, i.e. the biggest component is of size result[0] and the smallest is of size result[result.len() - 1]
Source

pub fn leaf_count(&self) -> usize

Count number of leaves in the graph, i.e. vertices with exactly one neighbor

Source

pub fn to_dot(&self) -> String

👎Deprecated since 0.3.0: Please use any method of the Dot trait instead, e.g., dot_with_indices
  • Creates String which contains the topology of the network in a format that can be used by circo etc. to generate a pdf of the graph.
  • indices are used as labels
  • search for graphviz to learn about .dot format
Source

pub fn to_dot_with_labels_from_contained<F, S1, S2>( &self, dot_options: S1, f: F, ) -> String
where S1: AsRef<str>, S2: AsRef<str>, F: Fn(&T, usize) -> S2,

👎Deprecated since 0.3.0: Please use any method of the DotExtra trait instead, e.g., dot_from_contained_index
§Example
use std::fs::File;
use std::io::prelude::*;
use net_ensembles::{Graph, EmptyNode, dot_constants::EXAMPLE_DOT_OPTIONS};

let mut graph: Graph<EmptyNode> = Graph::new(3);
graph.add_edge(0, 1).unwrap();
graph.add_edge(0, 2).unwrap();
graph.add_edge(1, 2).unwrap();

// create string of dotfile
let s = graph.to_dot_with_labels_from_contained(
   EXAMPLE_DOT_OPTIONS,
   |_contained, index| format!("Hey {}!", index)
);

// write to file
let mut f = File::create("example.dot").expect("Unable to create file");
f.write_all(s.as_bytes()).expect("Unable to write data");

In this example, example.dot now contains:

graph G{
    bgcolor="transparent";
    fontsize=50;
    node [shape=ellipse, penwidth=1, fontname="Courier", pin=true ];
    splines=true;
    0 1 2 ;
    "0" [label="Hey 0!"];
    "1" [label="Hey 1!"];
    "2" [label="Hey 2!"];
    0 -- 1
    0 -- 2
    1 -- 2
}

Then you can use, e.g.,

foo@bar:~$ circo example.dot -Tpdf > example.pdf

to create a pdf representation from it. Search for graphviz to learn more.

Source

pub fn to_dot_with_labels_from_container<F, S1, S2>( &self, dot_options: S1, f: F, ) -> String
where S1: AsRef<str>, S2: AsRef<str>, F: Fn(&A, usize) -> S2,

👎Deprecated since 0.3.0: Please use any method of the DotExtra trait instead, e.g., dot_from_container_index
§Same as to_dot_with_labels_from_contained but with access to neighbor information
§Example
use std::fs::File;
use std::io::prelude::*;
use net_ensembles::traits::*;
use net_ensembles::dot_constants::*;
use net_ensembles::{Graph,EmptyNode};

let mut graph: Graph<EmptyNode> = Graph::new(5);
graph.add_edge(0, 1).unwrap();
graph.add_edge(0, 2).unwrap();
graph.add_edge(1, 2).unwrap();
graph.add_edge(0, 3).unwrap();
graph.add_edge(3, 4).unwrap();

// create string of dotfile
let s = graph.to_dot_with_labels_from_container(
    &[SPLINES, NO_OVERLAP].join("\n\t"),
    |container, index|
    {
        container.contained();  // does nothing in this example, but you can still access
                                // contained, as you could in
                                // to_dot_with_labels_from_contained
        format!("index {}, degree: {}", index, container.degree())
    }
);

// write to file
let mut f = File::create("example_2.dot").expect("Unable to create file");
f.write_all(s.as_bytes()).expect("Unable to write data");

In this example, example_2.dot now contains:

graph G{
    splines=true;
    overlap=false;
    0 1 2 3 4 ;
    "0" [label="index 0, degree: 3"];
    "1" [label="index 1, degree: 2"];
    "2" [label="index 2, degree: 2"];
    "3" [label="index 3, degree: 2"];
    "4" [label="index 4, degree: 1"];
    0 -- 1
    0 -- 2
    0 -- 3
    1 -- 2
    3 -- 4
}

Then you can use, e.g.,

foo@bar:~$ circo example_2.dot -Tpdf > example_2.pdf

to create a pdf representation from it. Search for graphviz to learn more.

Source

pub fn diameter(&self) -> Option<usize>

  • returns None if graph not connected or does not contain any vertices
  • uses repeated breadth first search
Source

pub fn longest_shortest_path_from_index(&self, index: usize) -> Option<usize>

calculate the size of the longest shortest path starting from vertex with index index using breadth first search

Source

pub fn vertex_biconnected_components( self, alternative_definition: bool, ) -> Vec<usize>

§calculate sizes of all binode connected components
  • returns (reverse) ordered vector of sizes i.e. the biggest component is of size result[0] and the smallest is of size result[result.len() - 1]
  • destroys the underlying topology and therefore moves self
  • if you still need your graph, use self.clone().vertex_biconnected_components(false/true) for your calculations
§Definition: vertex_biconnected_components(false)

Here, the (vertex) biconnected component of a graph is defined as maximal subset of nodes, where any one node could be removed and the remaining nodes would still be a connected component.

§Note

Two vertices connected by an edge are considered to be biconnected, since after the removal of one vertex (and the corresponding edge), only one vertex remains. This vertex is in a connected component with itself.

§Alternative Definition: vertex_biconnected_components(true)

If you want to use the alternative definition:

The biconnected component is defined as maximal subset of vertices, where each vertex can be reached by at least two node independent paths

The alternative definition just removes all 2s from the result vector.

§Citations

I used the algorithm described in this paper:

J. Hobcroft and R. Tarjan, “Algorithm 447: Efficient Algorithms for Graph Manipulation” Commun. ACM, 16:372-378, 1973, DOI: 10.1145/362248.362272

You can also take a look at:

M. E. J. Newman, “Networks: an Introduction” Oxfort University Press, 2010, ISBN: 978-0-19-920665-0.

Source

pub fn vertex_load(&self, include_endpoints: bool) -> Vec<f64>

§calculates vertex_load of all vertices in O(edges * vertices)
  • calculates the vertex_load for every vertex
  • defined as how many shortest paths pass through each vertex
variant
vertex_load(true)includes endpoints in calculation (for a complete graph with N vertices, every node will have vertex_load N - 1)
vertex_load(false)excludes endpoints in calculation (for a complete graph with N vertices, every node will have vertex_load 0)
§Citations

I used the algorithm described in

M. E. J. Newman, “Scientific collaboration networks. II. Shortest paths, weighted networks, and centrality”, Phys. Rev. E 64, 016132, 2001, DOI: 10.1103/PhysRevE.64.016132

see also:

M. E. J. Newman, “Erratum: Scientific collaboration networks. II. Shortest paths, weighted networks, and centrality”, Phys. Rev. E 73, 039906, 2006, DOI: 10.1103/PhysRevE.73.039906

Source

pub fn transitivity(&self) -> f64

§Calculates transitivity of graph
  • related to cluster coefficient (Note: transitivity and cluster coefficient are similar, but not necessarily equal)
  • returns NaN, if there are no paths of length two in the graph
§Definition

transitivity = (number of closed paths of length two) / (number of paths of length two)

§Citations

For the definition see for example:

M. E. J. Newman, “Networks: an Introduction” Oxfort University Press, 2010, ISBN: 978-0-19-920665-0.

Source§

impl<T> GenericGraph<T, NodeContainer<T>>
where T: Node,

Source

pub fn complete_graph(n: usize) -> Self

Efficiently create a complete graph with n nodes

Source§

impl<T> GenericGraph<T, SwContainer<T>>

Source

pub fn reset_edge(&mut self, index0: usize, index1: usize) -> SwChangeState

§Reset small-world edge to its root state
  • panics if index out of bounds
  • in debug: panics if index0 == index1
Source

pub fn rewire_edge( &mut self, index0: usize, index1: usize, index2: usize, ) -> SwChangeState

§Rewire edges
  • rewire edge (index0, index1) to (index0, index2)
§panics
  • if indices are out of bounds
  • in debug: panics if index0 == index2
  • edge (index0, index1) has to be rooted at index0, else will panic in debug mode
Source

pub fn count_nodes_with_long_ranging_edges(&self) -> usize

§How many nodes have long ranging edges?
  • counts how many nodes have long ranging edges
  • A long ranging edge is defined as an edge, where is_at_root returns true, i.e., which is not in ist original ring configuration
Source

pub fn frac_nodes_wlre(&self) -> f64

§Fraction of nodes which have long ranging edges
  • A long ranging edge is defined as an edge, where is_at_root returns true, i.e., which is not in ist original ring configuration
Source

pub fn count_long_ranging_edges(&self) -> usize

§How many long ranging edges are there in the Graph?
  • A long ranging edge is defined as an edge, where is_at_root returns true, i.e., which is not in ist original ring configuration
Source

pub fn frac_long_ranging_edges(&self) -> f64

§Fraction of long ranging edges in the Graph?
  • A long ranging edge is defined as an edge, where is_at_root returns false, i.e., which is not in ist original ring configuration
  • this is: #longranging/#total
Source§

impl<T> GenericGraph<T, SpacialNodeContainer<T>>

Source

pub fn distance(&self, i: usize, j: usize) -> Option<f64>

§Euclidean distance between two vertices
  • Calculates the distance between the vertices corresponding to the indices i and j
  • None if any of the indices is out of bounds

Trait Implementations§

Source§

impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R>
where T: Node, R: Rng,

Source§

fn as_ref(&self) -> &Graph<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ConfigurationModel<T, R>
where T: Node,

Source§

fn as_ref(&self) -> &Graph<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R>
where T: Node, R: Rng,

Source§

fn as_ref(&self) -> &Graph<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T, R> AsRef<GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R>
where T: Node, R: Rng,

Source§

fn as_ref(&self) -> &Graph<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T, R> AsRef<GenericGraph<T, SpacialNodeContainer<T>>> for SpacialEnsemble<T, R>

Source§

fn as_ref(&self) -> &SpacialGraph<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T, R> AsRef<GenericGraph<T, SwContainer<T>>> for SwEnsemble<T, R>
where T: Node, R: Rng,

Source§

fn as_ref(&self) -> &SwGraph<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T, R> AsRef<GenericGraph<T, WSContainer<T>>> for SmallWorldWS<T, R>

Source§

fn as_ref(&self) -> &WSGraph<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R>
where T: Node, R: Rng,

Source§

fn borrow(&self) -> &Graph<T>

Immutably borrows from an owned value. Read more
Source§

impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ConfigurationModel<T, R>
where T: Node,

Source§

fn borrow(&self) -> &Graph<T>

Immutably borrows from an owned value. Read more
Source§

impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R>
where T: Node, R: Rng,

Source§

fn borrow(&self) -> &Graph<T>

Immutably borrows from an owned value. Read more
Source§

impl<T, R> Borrow<GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R>
where T: Node, R: Rng,

Source§

fn borrow(&self) -> &Graph<T>

Immutably borrows from an owned value. Read more
Source§

impl<T, R> Borrow<GenericGraph<T, SwContainer<T>>> for SwEnsemble<T, R>
where T: Node, R: Rng,

Source§

fn borrow(&self) -> &SwGraph<T>

Immutably borrows from an owned value. Read more
Source§

impl<T: Clone, A: Clone> Clone for GenericGraph<T, A>

Source§

fn clone(&self) -> GenericGraph<T, A>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, A: Debug> Debug for GenericGraph<T, A>

Source§

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

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

impl<'de, T, A> Deserialize<'de> for GenericGraph<T, A>
where A: 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<T, A> Dot for GenericGraph<T, A>
where T: Node, A: AdjContainer<T>,

Source§

fn dot_from_indices<F, W, S1, S2>( &self, writer: W, dot_options: S1, f: F, ) -> Result<(), Error>
where S1: AsRef<str>, S2: AsRef<str>, W: Write, F: FnMut(usize) -> S2,

use function f to create labels depending on the indexfor valid dot_options use dot_options! macro and take a look at module dot_constants Read more
Source§

fn dot_string_from_indices<F, S1, S2>(&self, dot_options: S1, f: F) -> String
where S1: AsRef<str>, S2: AsRef<str>, F: FnMut(usize) -> S2,

same as self.dot_from_indices but returns String instead Read more
Source§

fn dot_with_indices<S, W>(&self, writer: W, dot_options: S) -> Result<(), Error>
where S: AsRef<str>, W: Write,

use index as labels for the nodesdefault implementation uses dot_from_indices Read more
Source§

fn dot_string_with_indices<S>(&self, dot_options: S) -> String
where S: AsRef<str>,

same as self.dot_with_indices but returns String instead Read more
Source§

fn dot<S, W>(&self, writer: W, dot_options: S) -> Result<(), Error>
where S: AsRef<str>, W: Write,

create dot file with empty labelsdefault implementation uses dot_from_indices Read more
Source§

fn dot_string<S>(&self, dot_options: S) -> String
where S: AsRef<str>,

same as self.dot(), but returns a String instead Read more
Source§

impl<T, A> DotExtra<T, A> for GenericGraph<T, A>
where A: AdjContainer<T>,

Source§

fn dot_from_container_index<F, S1, S2, W>( &self, writer: W, dot_options: S1, f: F, ) -> Result<(), Error>
where S1: AsRef<str>, S2: AsRef<str>, F: FnMut(usize, &A) -> S2, W: Write,

create a dot representationyou can use the indices and the container A (usually stored at each index) to create the lables Read more
Source§

fn dot_from_contained_index<F, S1, S2, W>( &self, writer: W, dot_options: S1, f: F, ) -> Result<(), Error>
where W: Write, S1: AsRef<str>, S2: AsRef<str>, F: FnMut(usize, &T) -> S2,

create a dot representationyou can use the indices and T (usually something contained in A (see dot_from_container) and stored at each vertex) to create the lables Read more
Source§

fn dot_string_from_container_index<F, S1, S2>( &self, dot_options: S1, f: F, ) -> String
where S1: AsRef<str>, S2: AsRef<str>, F: FnMut(usize, &A) -> S2,

same as self.dot_string_from_container_index but returns String instead Read more
Source§

fn dot_from_container<F, S1, S2, W>( &self, writer: W, dot_options: S1, f: F, ) -> Result<(), Error>
where S1: AsRef<str>, S2: AsRef<str>, F: FnMut(&A) -> S2, W: Write,

create a dot representationyou can use the information of the container A (usually stored at each index) to create the lables Read more
Source§

fn dot_string_from_container<F, S1, S2>(&self, dot_options: S1, f: F) -> String
where S1: AsRef<str>, S2: AsRef<str>, F: FnMut(&A) -> S2,

same as self.dot_from_container but returns String instead Read more
Source§

fn dot_string_from_contained_index<F, S1, S2>( &self, dot_options: S1, f: F, ) -> String
where S1: AsRef<str>, S2: AsRef<str>, F: FnMut(usize, &T) -> S2,

same as self.dot_from_contained but returns String instead Read more
Source§

fn dot_from_contained<F, S1, S2, W>( &self, writer: W, dot_options: S1, f: F, ) -> Result<(), Error>
where W: Write, S1: AsRef<str>, S2: AsRef<str>, F: FnMut(&T) -> S2,

create a dot representationyou can use T (usually something contained in A (see dot_from_container) and stored at each vertex) to create the lables Read more
Source§

fn dot_string_from_contained<F, S1, S2>(&self, dot_options: S1, f: F) -> String
where S1: AsRef<str>, S2: AsRef<str>, F: FnMut(&T) -> S2,

same as self.dot_from_contained but returns String Read more
Source§

impl<T: Node, A: AdjContainer<T>> From<&GenericGraph<T, A>> for Graph<T>

Source§

fn from(source: &GenericGraph<T, A>) -> Self

Converts to this type from the input type.
Source§

impl<T, R> GraphIterators<T, GenericGraph<T, WSContainer<T>>, WSContainer<T>> for SmallWorldWS<T, R>
where T: Node + SerdeStateConform, R: Rng,

Source§

fn contained_iter(&self) -> ContainedIter<'_, T, WSContainer<T>>

get iterator over additional information stored at each vertex in order of the indicesiterator returns a Node (for example EmptyNode or whatever you used)similar to self.container_iter().map(|container| container.contained()) Read more
Source§

fn contained_iter_neighbors( &self, index: usize, ) -> NContainedIter<'_, T, WSContainer<T>>

iterate over additional information of neighbors of vertex indexiterator returns &Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_neighbors_with_index( &self, index: usize, ) -> NIContainedIter<'_, T, WSContainer<T>>

iterate over additional information of neighbors of vertex indexiterator returns (index_neighbor,&T)sort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn container_iter(&self) -> Iter<'_, WSContainer<T>>

get iterator over AdjContainer in order of the indicesiterator returns AdjContainer<Node>, i.e., A Read more
Source§

fn container_iter_neighbors( &self, index: usize, ) -> NContainerIter<'_, T, WSContainer<T>>

iterate over additional information of neighbors of vertex indexiterator returns &Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn dfs(&self, index: usize) -> Dfs<'_, T, WSContainer<T>>

returns Iterator Read more
Source§

fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, WSContainer<T>>

returns Iterator Read more
Source§

fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, WSContainer<T>>

returns Iterator Read more
Source§

impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for BAensemble<T, R>
where T: Node + SerdeStateConform, R: Rng,

Source§

fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, NodeContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns &mut Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, NodeContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns (index_neighbor: usize, neighbor: &mut T)sort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>

get iterator over mutable additional information stored at each vertex in order of the indicesiterator returns a Node (for example EmptyNode or whatever you used) Read more
Source§

impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ConfigurationModel<T, R>
where T: Node,

Source§

fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, NodeContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns &mut Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, NodeContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns (index_neighbor: usize, neighbor: &mut T)sort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>

get iterator over mutable additional information stored at each vertex in order of the indicesiterator returns a Node (for example EmptyNode or whatever you used) Read more
Source§

impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleC<T, R>
where T: Node + SerdeStateConform, R: Rng,

Source§

fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, NodeContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns &mut Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, NodeContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns (index_neighbor: usize, neighbor: &mut T)sort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>

get iterator over mutable additional information stored at each vertex in order of the indicesiterator returns a Node (for example EmptyNode or whatever you used) Read more
Source§

impl<T, R> GraphIteratorsMut<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for ErEnsembleM<T, R>
where T: Node + SerdeStateConform, R: Rng,

Source§

fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, NodeContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns &mut Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, NodeContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns (index_neighbor: usize, neighbor: &mut T)sort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, NodeContainer<T>>

get iterator over mutable additional information stored at each vertex in order of the indicesiterator returns a Node (for example EmptyNode or whatever you used) Read more
Source§

impl<T, R> GraphIteratorsMut<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for SwEnsemble<T, R>
where T: Node + SerdeStateConform, R: Rng,

Source§

fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, SwContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns &mut Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, SwContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns (index_neighbor: usize, neighbor: &mut T)sort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, SwContainer<T>>

get iterator over mutable additional information stored at each vertex in order of the indicesiterator returns a Node (for example EmptyNode or whatever you used) Read more
Source§

impl<T, R> GraphIteratorsMut<T, GenericGraph<T, WSContainer<T>>, WSContainer<T>> for SmallWorldWS<T, R>
where T: Node + SerdeStateConform, R: Rng,

Source§

fn contained_iter_neighbors_mut( &mut self, index: usize, ) -> NContainedIterMut<'_, T, WSContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns &mut Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_neighbors_mut_with_index( &mut self, index: usize, ) -> INContainedIterMut<'_, T, WSContainer<T>>

iterate over mutable additional information of neighbors of vertex indexiterator returns (index_neighbor: usize, neighbor: &mut T)sort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_mut(&mut self) -> ContainedIterMut<'_, T, WSContainer<T>>

get iterator over mutable additional information stored at each vertex in order of the indicesiterator returns a Node (for example EmptyNode or whatever you used) Read more
Source§

impl<T, A> Serialize for GenericGraph<T, A>
where A: 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<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for BAensemble<T, R>
where T: Node + SerdeStateConform, R: Rng,

Source§

fn at(&self, index: usize) -> &T

access additional information at index Read more
Source§

fn at_mut(&mut self, index: usize) -> &mut T

mutable access to additional information at index Read more
Source§

fn graph(&self) -> &Graph<T>

returns reference to the underlying topology aka, the GenericGraphuse this to call functions regarding the topology Read more
Source§

fn sort_adj(&mut self)

sorts Adjecaency List Read more
Source§

impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ConfigurationModel<T, R>
where T: Node,

Source§

fn sort_adj(&mut self)

§Sort adjecency lists

If you depend on the order of the adjecency lists, you can sort them

§Performance
  • internally uses pattern-defeating quicksort as long as that is the standard
  • sorts an adjecency list with length d in worst-case: O(d log(d))
  • is called for each adjecency list, i.e., self.vertex_count() times
Source§

fn at(&self, index: usize) -> &T

access additional information at index Read more
Source§

fn at_mut(&mut self, index: usize) -> &mut T

mutable access to additional information at index Read more
Source§

fn graph(&self) -> &Graph<T>

returns reference to the underlying topology aka, the GenericGraphuse this to call functions regarding the topology Read more
Source§

impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ErEnsembleC<T, R>
where T: Node + SerdeStateConform, R: Rng,

Source§

fn sort_adj(&mut self)

§Sort adjecency lists

If you depend on the order of the adjecency lists, you can sort them

§Performance
  • internally uses pattern-defeating quicksort as long as that is the standard
  • sorts an adjecency list with length d in worst-case: O(d log(d))
  • is called for each adjecency list, i.e., self.vertex_count() times
Source§

fn at(&self, index: usize) -> &T

access additional information at index Read more
Source§

fn at_mut(&mut self, index: usize) -> &mut T

mutable access to additional information at index Read more
Source§

fn graph(&self) -> &Graph<T>

returns reference to the underlying topology aka, the GenericGraphuse this to call functions regarding the topology Read more
Source§

impl<T, R> WithGraph<T, GenericGraph<T, NodeContainer<T>>> for ErEnsembleM<T, R>
where T: Node + SerdeStateConform, R: Rng,

Source§

fn sort_adj(&mut self)

§Sort adjecency lists

If you depend on the order of the adjecency lists, you can sort them

§Performance
  • internally uses pattern-defeating quicksort as long as that is the standard
  • sorts an adjecency list with length d in worst-case: O(d log(d))
  • is called for each adjecency list, i.e., self.vertex_count() times
Source§

fn at(&self, index: usize) -> &T

access additional information at index Read more
Source§

fn at_mut(&mut self, index: usize) -> &mut T

mutable access to additional information at index Read more
Source§

fn graph(&self) -> &Graph<T>

returns reference to the underlying topology aka, the GenericGraphuse this to call functions regarding the topology Read more
Source§

impl<T, R> WithGraph<T, GenericGraph<T, SwContainer<T>>> for SwEnsemble<T, R>
where T: Node + SerdeStateConform, R: Rng,

Source§

fn sort_adj(&mut self)

§Sort adjecency lists

If you depend on the order of the adjecency lists, you can sort them

§Performance
  • internally uses pattern-defeating quicksort as long as that is the standard
  • sorts an adjecency list with length d in worst-case: O(d log(d))
  • is called for each adjecency list, i.e., self.vertex_count() times
Source§

fn at(&self, index: usize) -> &T

access additional information at index Read more
Source§

fn at_mut(&mut self, index: usize) -> &mut T

mutable access to additional information at index Read more
Source§

fn graph(&self) -> &SwGraph<T>

returns reference to the underlying topology aka, the GenericGraphuse this to call functions regarding the topology Read more
Source§

impl<T, R> WithGraph<T, GenericGraph<T, WSContainer<T>>> for SmallWorldWS<T, R>

Source§

fn at(&self, index: usize) -> &T

access additional information at index Read more
Source§

fn at_mut(&mut self, index: usize) -> &mut T

mutable access to additional information at index Read more
Source§

fn graph(&self) -> &WSGraph<T>

returns reference to the underlying topology aka, the GenericGraphuse this to call functions regarding the topology Read more
Source§

fn sort_adj(&mut self)

sorts Adjecaency List Read more

Auto Trait Implementations§

§

impl<T, A> Freeze for GenericGraph<T, A>

§

impl<T, A> RefUnwindSafe for GenericGraph<T, A>

§

impl<T, A> Send for GenericGraph<T, A>
where T: Send, A: Send,

§

impl<T, A> Sync for GenericGraph<T, A>
where T: Sync, A: Sync,

§

impl<T, A> Unpin for GenericGraph<T, A>
where T: Unpin, A: Unpin,

§

impl<T, A> UnwindSafe for GenericGraph<T, A>
where T: UnwindSafe, A: 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<S, T> Cast<T> for S
where T: Conv<S>,

Source§

fn cast(self) -> T

Cast from Self to T
Source§

fn try_cast(self) -> Result<T, Error>

Try converting from Self to T
Source§

impl<S, T> CastFloat<T> for S
where T: ConvFloat<S>,

Source§

fn cast_trunc(self) -> T

Cast to integer, truncating Read more
Source§

fn cast_nearest(self) -> T

Cast to the nearest integer Read more
Source§

fn cast_floor(self) -> T

Cast the floor to an integer Read more
Source§

fn cast_ceil(self) -> T

Cast the ceiling to an integer Read more
Source§

fn try_cast_trunc(self) -> Result<T, Error>

Try converting to integer with truncation Read more
Source§

fn try_cast_nearest(self) -> Result<T, Error>

Try converting to the nearest integer Read more
Source§

fn try_cast_floor(self) -> Result<T, Error>

Try converting the floor to an integer Read more
Source§

fn try_cast_ceil(self) -> Result<T, Error>

Try convert the ceiling to an integer 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> Conv<T> for T

Source§

fn conv(v: T) -> T

Convert from T to Self
Source§

fn try_conv(v: T) -> Result<T, Error>

Try converting from T to Self
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, E> GraphIterators<T, GenericGraph<T, NodeContainer<T>>, NodeContainer<T>> for E
where T: Node, E: WithGraph<T, GenericGraph<T, NodeContainer<T>>>,

Source§

fn contained_iter(&self) -> ContainedIter<'_, T, NodeContainer<T>>

get iterator over additional information stored at each vertex in order of the indicesiterator returns a Node (for example EmptyNode or whatever you used)similar to self.container_iter().map(|container| container.contained()) Read more
Source§

fn contained_iter_neighbors( &self, index: usize, ) -> NContainedIter<'_, T, NodeContainer<T>>

iterate over additional information of neighbors of vertex indexiterator returns &Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn container_iter(&self) -> Iter<'_, NodeContainer<T>>

get iterator over AdjContainer in order of the indicesiterator returns AdjContainer<Node>, i.e., A Read more
Source§

fn container_iter_neighbors( &self, index: usize, ) -> NContainerIter<'_, T, NodeContainer<T>>

iterate over additional information of neighbors of vertex indexiterator returns &Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_neighbors_with_index( &self, index: usize, ) -> NIContainedIter<'_, T, NodeContainer<T>>

iterate over additional information of neighbors of vertex indexiterator returns (index_neighbor,&T)sort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn dfs(&self, index: usize) -> Dfs<'_, T, NodeContainer<T>>

returns Iterator Read more
Source§

fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, NodeContainer<T>>

returns Iterator Read more
Source§

fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, NodeContainer<T>>

returns Iterator Read more
Source§

impl<T, E> GraphIterators<T, GenericGraph<T, SwContainer<T>>, SwContainer<T>> for E
where T: Node, E: WithGraph<T, GenericGraph<T, SwContainer<T>>>,

Source§

fn contained_iter(&self) -> ContainedIter<'_, T, SwContainer<T>>

get iterator over additional information stored at each vertex in order of the indicesiterator returns a Node (for example EmptyNode or whatever you used)similar to self.container_iter().map(|container| container.contained()) Read more
Source§

fn contained_iter_neighbors( &self, index: usize, ) -> NContainedIter<'_, T, SwContainer<T>>

iterate over additional information of neighbors of vertex indexiterator returns &Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn container_iter(&self) -> Iter<'_, SwContainer<T>>

get iterator over AdjContainer in order of the indicesiterator returns AdjContainer<Node>, i.e., A Read more
Source§

fn container_iter_neighbors( &self, index: usize, ) -> NContainerIter<'_, T, SwContainer<T>>

iterate over additional information of neighbors of vertex indexiterator returns &Tsort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn contained_iter_neighbors_with_index( &self, index: usize, ) -> NIContainedIter<'_, T, SwContainer<T>>

iterate over additional information of neighbors of vertex indexiterator returns (index_neighbor,&T)sort_adj will affect the orderpanics if index out of bounds Read more
Source§

fn dfs(&self, index: usize) -> Dfs<'_, T, SwContainer<T>>

returns Iterator Read more
Source§

fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, SwContainer<T>>

returns Iterator Read more
Source§

fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, SwContainer<T>>

returns Iterator Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T, A, E> MeasurableGraphQuantities<GenericGraph<T, A>> for E
where T: Node, A: AdjContainer<T>, GenericGraph<T, A>: Clone, E: AsRef<GenericGraph<T, A>>,

Source§

fn average_degree(&self) -> f32

calculates the average degree of the graph Read more
Source§

fn degree(&self, index: usize) -> Option<usize>

returns number of vertices adjacent to vertex indexNone if index out of bounds Read more
Source§

fn connected_components(&self) -> Vec<usize>

compute sizes of all connected components Read more
Source§

fn diameter(&self) -> Option<usize>

returns None if graph not connected or does not contain any verticesuses repeated breadth first search Read more
Source§

fn edge_count(&self) -> usize

returns total number of edges in graph
Source§

fn is_connected(&self) -> Option<bool>

Source§

fn leaf_count(&self) -> usize

Count number of leaves in the graph, i.e. vertices with exactly one neighbor
Source§

fn longest_shortest_path_from_index(&self, index: usize) -> Option<usize>

calculate the size of the longest shortest path starting from vertex with index index using breadth first search
Source§

fn q_core(&self, q: usize) -> Option<usize>

definition Read more
Source§

fn transitivity(&self) -> f64

Calculates transitivity of graph Read more
Source§

fn vertex_biconnected_components( &self, alternative_definition: bool, ) -> Vec<usize>

calculate sizes of all binode connected components Read more
Source§

fn vertex_count(&self) -> usize

returns number of vertices present in graph
Source§

fn vertex_load(&self, include_endpoints: bool) -> Vec<f64>

Closely related (most of the time equal) to betweeness Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

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

Source§

impl<T> SerdeStateConform for T
where T: Serialize,