pub struct Edge { /* private fields */ }
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn id(&self) -> &GID
pub fn id(&self) -> &GID
Examples found in repository?
examples/edge.rs (line 19)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = GremlinClient::connect("localhost")?;
5
6 // Find outgoing edges for V[1]
7 let results = client
8 .execute("g.V(param).outE()", &[("param", &1)])?
9 .filter_map(Result::ok)
10 .map(|f| f.take::<Edge>())
11 .collect::<Result<Vec<Edge>, _>>()?;
12
13 println!("Edges count {}", results.len());
14
15 let first = &results[0];
16
17 println!(
18 "Edge with id: [{}] and label: [{}] from: [{}] to: [{}]",
19 first.id().get::<i32>()?,
20 first.label(),
21 first.out_v().id().get::<i64>()?,
22 first.in_v().id().get::<i64>()?
23 );
24
25 Ok(())
26}
Sourcepub fn label(&self) -> &String
pub fn label(&self) -> &String
Examples found in repository?
examples/edge.rs (line 20)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = GremlinClient::connect("localhost")?;
5
6 // Find outgoing edges for V[1]
7 let results = client
8 .execute("g.V(param).outE()", &[("param", &1)])?
9 .filter_map(Result::ok)
10 .map(|f| f.take::<Edge>())
11 .collect::<Result<Vec<Edge>, _>>()?;
12
13 println!("Edges count {}", results.len());
14
15 let first = &results[0];
16
17 println!(
18 "Edge with id: [{}] and label: [{}] from: [{}] to: [{}]",
19 first.id().get::<i32>()?,
20 first.label(),
21 first.out_v().id().get::<i64>()?,
22 first.in_v().id().get::<i64>()?
23 );
24
25 Ok(())
26}
Sourcepub fn in_v(&self) -> &Vertex
pub fn in_v(&self) -> &Vertex
Examples found in repository?
examples/edge.rs (line 22)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = GremlinClient::connect("localhost")?;
5
6 // Find outgoing edges for V[1]
7 let results = client
8 .execute("g.V(param).outE()", &[("param", &1)])?
9 .filter_map(Result::ok)
10 .map(|f| f.take::<Edge>())
11 .collect::<Result<Vec<Edge>, _>>()?;
12
13 println!("Edges count {}", results.len());
14
15 let first = &results[0];
16
17 println!(
18 "Edge with id: [{}] and label: [{}] from: [{}] to: [{}]",
19 first.id().get::<i32>()?,
20 first.label(),
21 first.out_v().id().get::<i64>()?,
22 first.in_v().id().get::<i64>()?
23 );
24
25 Ok(())
26}
Sourcepub fn out_v(&self) -> &Vertex
pub fn out_v(&self) -> &Vertex
Examples found in repository?
examples/edge.rs (line 21)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = GremlinClient::connect("localhost")?;
5
6 // Find outgoing edges for V[1]
7 let results = client
8 .execute("g.V(param).outE()", &[("param", &1)])?
9 .filter_map(Result::ok)
10 .map(|f| f.take::<Edge>())
11 .collect::<Result<Vec<Edge>, _>>()?;
12
13 println!("Edges count {}", results.len());
14
15 let first = &results[0];
16
17 println!(
18 "Edge with id: [{}] and label: [{}] from: [{}] to: [{}]",
19 first.id().get::<i32>()?,
20 first.label(),
21 first.out_v().id().get::<i64>()?,
22 first.in_v().id().get::<i64>()?
23 );
24
25 Ok(())
26}
pub fn iter(&self) -> Iter<'_, String, Property>
pub fn property(&self, key: &str) -> Option<&Property>
Trait Implementations§
Source§impl IntoIterator for Edge
impl IntoIterator for Edge
impl Eq for Edge
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