#[repr(C)]pub struct igraph_attribute_table_t {Show 21 fields
pub init: Option<unsafe extern "C" fn(graph: *mut igraph_t, attr: *const igraph_attribute_record_list_t) -> igraph_error_t>,
pub destroy: Option<unsafe extern "C" fn(graph: *mut igraph_t)>,
pub copy: Option<unsafe extern "C" fn(to: *mut igraph_t, from: *const igraph_t, ga: igraph_bool_t, va: igraph_bool_t, ea: igraph_bool_t) -> igraph_error_t>,
pub add_vertices: Option<unsafe extern "C" fn(graph: *mut igraph_t, nv: igraph_int_t, attr: *const igraph_attribute_record_list_t) -> igraph_error_t>,
pub permute_vertices: Option<unsafe extern "C" fn(graph: *const igraph_t, newgraph: *mut igraph_t, idx: *const igraph_vector_int_t) -> igraph_error_t>,
pub combine_vertices: Option<unsafe extern "C" fn(graph: *const igraph_t, newgraph: *mut igraph_t, merges: *const igraph_vector_int_list_t, comb: *const igraph_attribute_combination_t) -> igraph_error_t>,
pub add_edges: Option<unsafe extern "C" fn(graph: *mut igraph_t, edges: *const igraph_vector_int_t, attr: *const igraph_attribute_record_list_t) -> igraph_error_t>,
pub permute_edges: Option<unsafe extern "C" fn(graph: *const igraph_t, newgraph: *mut igraph_t, idx: *const igraph_vector_int_t) -> igraph_error_t>,
pub combine_edges: Option<unsafe extern "C" fn(graph: *const igraph_t, newgraph: *mut igraph_t, merges: *const igraph_vector_int_list_t, comb: *const igraph_attribute_combination_t) -> igraph_error_t>,
pub get_info: Option<unsafe extern "C" fn(graph: *const igraph_t, gnames: *mut igraph_strvector_t, gtypes: *mut igraph_vector_int_t, vnames: *mut igraph_strvector_t, vtypes: *mut igraph_vector_int_t, enames: *mut igraph_strvector_t, etypes: *mut igraph_vector_int_t) -> igraph_error_t>,
pub has_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, type_: igraph_attribute_elemtype_t, name: *const c_char) -> igraph_bool_t>,
pub get_type: Option<unsafe extern "C" fn(graph: *const igraph_t, type_: *mut igraph_attribute_type_t, elemtype: igraph_attribute_elemtype_t, name: *const c_char) -> igraph_error_t>,
pub get_numeric_graph_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, value: *mut igraph_vector_t) -> igraph_error_t>,
pub get_string_graph_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, value: *mut igraph_strvector_t) -> igraph_error_t>,
pub get_bool_graph_attr: Option<unsafe extern "C" fn(igraph: *const igraph_t, name: *const c_char, value: *mut igraph_vector_bool_t) -> igraph_error_t>,
pub get_numeric_vertex_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, vs: igraph_vs_t, value: *mut igraph_vector_t) -> igraph_error_t>,
pub get_string_vertex_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, vs: igraph_vs_t, value: *mut igraph_strvector_t) -> igraph_error_t>,
pub get_bool_vertex_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, vs: igraph_vs_t, value: *mut igraph_vector_bool_t) -> igraph_error_t>,
pub get_numeric_edge_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, es: igraph_es_t, value: *mut igraph_vector_t) -> igraph_error_t>,
pub get_string_edge_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, es: igraph_es_t, value: *mut igraph_strvector_t) -> igraph_error_t>,
pub get_bool_edge_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, es: igraph_es_t, value: *mut igraph_vector_bool_t) -> igraph_error_t>,
}Expand description
\struct igraph_attribute_table_t \brief Table of functions to perform operations on attributes.
This type collects the functions defining an attribute handler. It has the following members:
\member init This function is called whenever a new graph object is created, right after it is created but before any vertices or edges are added. It is supposed to set the \c attr member of the \c igraph_t object, which is guaranteed to be set to a null pointer before this function is called. It is expected to set the \c attr member to a non-null value \em or return an error code. Leaving the \c attr member at a null value while returning success is invalid and will trigger an error in the C core of igraph itself. \member destroy This function is called whenever the graph object is destroyed, right before freeing the allocated memory. It is supposed to do any cleanup operations that are need to dispose of the \c attr member of the \c igraph_t object properly. The caller will set the \c attr member to a null pointer after this function returns. \member copy This function is called when the C core wants to populate the attributes of a graph from another graph. The structure of the target graph is already initialized by the time this function is called, and the \c attr member of the graph is set to a null pointer. The function is supposed to populate the \c attr member of the target \c igraph_t object to a non-null value \em or return an error code. Leaving the \c attr member at a null value while returning success is invalid and will trigger an error in the C core of igraph itself. \member add_vertices Called when vertices are added to a graph, after the base data structure was modified. The number of vertices that were added is supplied as an argument. The function is supposed to set up default values for each vertex attribute that is currently registered on the graph, for all the newly added vertices. Expected to return an error code. \member permute_vertices Called when a new graph is created based on an existing one such that there is a mapping from the vertices of the new graph back to the vertices of the old graph (e.g. if vertices are removed from a graph). The supplied index vector defines which old vertex a new vertex corresponds to. Its length is the same as the number of vertices in the new graph, and for each new vertex it provides the ID of the corresponding vertex in the old graph. The function is supposed to set up the values of the vertex attributes of the new graph based on the attributes of the old graph and the provided index vector. Note that the old and the new graph \em may be the same, in which case it is the responsibility of the function to ensure that the operation can safely be performed in-place. If the two graph instances are \em not the same, implementors may safely assume that the new graph has no vertex attributes yet (but it may already have graph or edge attributes by the time this function is called). \member combine_vertices This function is called when the creation of a new graph involves a merge (contraction, etc.) of vertices from another graph. The function is called after the new graph was created. An argument specifies how several vertices from the old graph map to a single vertex in the new graph. It is guaranteed that the old and the new graph instances are different when this callback is called. Implementors may safely assume that the new graph has no vertex attributes yet (but it may already have graph or edge attributes by the time this function is called). \member add_edges Called when new edges are added to a graph, after the base data structure was modified. A vector containing the endpoints of the new edges are supplied as an argument. The function is supposed to set up default values for each edge attribute that is currently registered on the graph, for all the newly added edges. Expected to return an error code. \member permute_edges Called when a new graph is created based on an existing one such that some of the edges in the new graph should copy the attributes of some edges from the old graph (this also includes the deletion of edges). The supplied index vector defines which old edge a new edge corresponds to. Its length is the same as the number of edges in the new graph, and for each edge it provides the ID of the corresponding edge in the old graph. The function is supposed to set up the values of the edge attributes of the new graph based on the attributes of the old graph and the provided index vector. Note that the old and the new graph \em may be the same, in which case it is the responsibility of the function to ensure that the operation can safely be performed in-place. If the two graph instances are \em not the same, implementors may safely assume that the new graph has no edge attributes yet (but it may already have graph or vertex attributes by the time this function is called). \member combine_edges This function is called when the creation of a new graph involves a merge (contraction, etc.) of edges from another graph. The function is after the new graph was created. An argument specifies how several edges from the old graph map to a single edge in the new graph. It is guaranteed that the old and the new graph instances are different when this callback is called. Implementors may safely assume that the new graph has no edge attributes yet (but it may already have graph or vertex attributes by the time this function is called). \member get_info Query the attributes of a graph, the names and types should be returned. \member has_attr Check whether a graph has the named graph/vertex/edge attribute. \member get_type Query the type of a graph/vertex/edge attribute. \member get_numeric_graph_attr Query a numeric graph attribute. The value should be appended to the provided \p value vector. No assumptions should be made about the initial contents of the \p value vector and it is not guaranteed to be empty. \member get_string_graph_attr Query a string graph attribute. The value should be appended to the provided \p value vector. No assumptions should be made about the initial contents of the \p value vector and it is not guaranteed to be empty. \member get_bool_graph_attr Query a boolean graph attribute. The value should be appended to the provided \p value vector. No assumptions should be made about the initial contents of the \p value vector and it is not guaranteed to be empty. \member get_numeric_vertex_attr Query a numeric vertex attribute, for the vertices included in \p vs. The attribute values should be appended to the provided \p value vector. No assumptions should be made about the initial contents of the \p value vector and it is not guaranteed to be empty. \member get_string_vertex_attr Query a string vertex attribute, for the vertices included in \p vs. The attribute values should be appended to the provided \p value vector. No assumptions should be made about the initial contents of the \p value vector and it is not guaranteed to be empty. \member get_bool_vertex_attr Query a boolean vertex attribute, for the vertices included in \p vs. The attribute values should be appended to the provided \p value vector. No assumptions should be made about the initial contents of the \p value vector and it is not guaranteed to be empty. \member get_numeric_edge_attr Query a numeric edge attribute, for the edges included in \p es. The attribute values should be appended to the provided \p value vector. No assumptions should be made about the initial contents of the \p value vector and it is not guaranteed to be empty. \member get_string_edge_attr Query a string edge attribute, for the the edges included in \p es. The attribute values should be appended to the provided \p value vector. No assumptions should be made about the initial contents of the \p value vector and it is not guaranteed to be empty. \member get_bool_edge_attr Query a boolean edge attribute, for the the edges included in \p es. The attribute values should be appended to the provided \p value vector. No assumptions should be made about the initial contents of the \p value vector and it is not guaranteed to be empty.
Fields§
§init: Option<unsafe extern "C" fn(graph: *mut igraph_t, attr: *const igraph_attribute_record_list_t) -> igraph_error_t>§destroy: Option<unsafe extern "C" fn(graph: *mut igraph_t)>§copy: Option<unsafe extern "C" fn(to: *mut igraph_t, from: *const igraph_t, ga: igraph_bool_t, va: igraph_bool_t, ea: igraph_bool_t) -> igraph_error_t>§add_vertices: Option<unsafe extern "C" fn(graph: *mut igraph_t, nv: igraph_int_t, attr: *const igraph_attribute_record_list_t) -> igraph_error_t>§permute_vertices: Option<unsafe extern "C" fn(graph: *const igraph_t, newgraph: *mut igraph_t, idx: *const igraph_vector_int_t) -> igraph_error_t>§combine_vertices: Option<unsafe extern "C" fn(graph: *const igraph_t, newgraph: *mut igraph_t, merges: *const igraph_vector_int_list_t, comb: *const igraph_attribute_combination_t) -> igraph_error_t>§add_edges: Option<unsafe extern "C" fn(graph: *mut igraph_t, edges: *const igraph_vector_int_t, attr: *const igraph_attribute_record_list_t) -> igraph_error_t>§permute_edges: Option<unsafe extern "C" fn(graph: *const igraph_t, newgraph: *mut igraph_t, idx: *const igraph_vector_int_t) -> igraph_error_t>§combine_edges: Option<unsafe extern "C" fn(graph: *const igraph_t, newgraph: *mut igraph_t, merges: *const igraph_vector_int_list_t, comb: *const igraph_attribute_combination_t) -> igraph_error_t>§get_info: Option<unsafe extern "C" fn(graph: *const igraph_t, gnames: *mut igraph_strvector_t, gtypes: *mut igraph_vector_int_t, vnames: *mut igraph_strvector_t, vtypes: *mut igraph_vector_int_t, enames: *mut igraph_strvector_t, etypes: *mut igraph_vector_int_t) -> igraph_error_t>§has_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, type_: igraph_attribute_elemtype_t, name: *const c_char) -> igraph_bool_t>§get_type: Option<unsafe extern "C" fn(graph: *const igraph_t, type_: *mut igraph_attribute_type_t, elemtype: igraph_attribute_elemtype_t, name: *const c_char) -> igraph_error_t>§get_numeric_graph_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, value: *mut igraph_vector_t) -> igraph_error_t>§get_string_graph_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, value: *mut igraph_strvector_t) -> igraph_error_t>§get_bool_graph_attr: Option<unsafe extern "C" fn(igraph: *const igraph_t, name: *const c_char, value: *mut igraph_vector_bool_t) -> igraph_error_t>§get_numeric_vertex_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, vs: igraph_vs_t, value: *mut igraph_vector_t) -> igraph_error_t>§get_string_vertex_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, vs: igraph_vs_t, value: *mut igraph_strvector_t) -> igraph_error_t>§get_bool_vertex_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, vs: igraph_vs_t, value: *mut igraph_vector_bool_t) -> igraph_error_t>§get_numeric_edge_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, es: igraph_es_t, value: *mut igraph_vector_t) -> igraph_error_t>§get_string_edge_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, es: igraph_es_t, value: *mut igraph_strvector_t) -> igraph_error_t>§get_bool_edge_attr: Option<unsafe extern "C" fn(graph: *const igraph_t, name: *const c_char, es: igraph_es_t, value: *mut igraph_vector_bool_t) -> igraph_error_t>Trait Implementations§
Source§impl Clone for igraph_attribute_table_t
impl Clone for igraph_attribute_table_t
Source§fn clone(&self) -> igraph_attribute_table_t
fn clone(&self) -> igraph_attribute_table_t
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more