pub struct Edge {
pub guid: String,
pub name: String,
pub v0: String,
pub v1: String,
pub attribute: String,
pub index: i32,
}
Expand description
A graph edge with a unique identifier and attribute string.
Fields§
§guid: String
The unique identifier of the edge.
name: String
The name of the edge.
v0: String
The first vertex of the edge.
v1: String
The second vertex of the edge.
attribute: String
Edge attribute data as string.
index: i32
Integer index for the edge.
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn new(
name: Option<String>,
v0: Option<String>,
v1: Option<String>,
attribute: Option<String>,
) -> Self
pub fn new( name: Option<String>, v0: Option<String>, v1: Option<String>, attribute: Option<String>, ) -> Self
Initialize a new Edge.
Sourcepub fn to_json_data(&self) -> Result<String, Box<dyn Error>>
pub fn to_json_data(&self) -> Result<String, Box<dyn Error>>
Convert the Edge to a JSON-serializable string.
Sourcepub fn from_json_data(json_data: &str) -> Result<Self, Box<dyn Error>>
pub fn from_json_data(json_data: &str) -> Result<Self, Box<dyn Error>>
Create Edge from JSON string data.
Sourcepub fn other_vertex(&self, vertex_id: &str) -> String
pub fn other_vertex(&self, vertex_id: &str) -> String
Get the other vertex ID connected by this edge.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Edge
impl<'de> Deserialize<'de> for Edge
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Edge
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnwindSafe for Edge
Blanket Implementations§
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
Mutably borrows from an owned value. Read more