Struct gremlin_client::structure::VertexProperty
source · pub struct VertexProperty { /* private fields */ }
Implementations§
source§impl VertexProperty
impl VertexProperty
pub fn new<G, T, GT>(id: G, label: T, value: GT) -> VertexProperty
pub fn id(&self) -> &GID
pub fn value(&self) -> &GValue
pub fn take<T>(self) -> GremlinResult<T>where
T: FromGValue,
sourcepub fn get<'a, T>(&'a self) -> GremlinResult<&'a T>where
T: BorrowFromGValue,
pub fn get<'a, T>(&'a self) -> GremlinResult<&'a T>where
T: BorrowFromGValue,
Examples found in repository?
examples/vertex_properties.rs (line 12)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = GremlinClient::connect("localhost")?;
let results = client
.execute("g.V(param).properties()", &[("param", &1)])?
.filter_map(Result::ok)
.map(|f| f.take::<VertexProperty>())
.collect::<Result<Vec<VertexProperty>, _>>()?;
println!("{:?}", results[0].get::<String>()?);
let results = client
.execute("g.V(param).propertyMap()", &[("param", &1)])?
.filter_map(Result::ok)
.map(|f| f.take::<Map>())
.collect::<Result<Vec<Map>, _>>()?;
println!(
"{:?}",
results[0]["name"].get::<List>()?[0]
.get::<VertexProperty>()?
.get::<String>()?
);
Ok(())
}
pub fn label(&self) -> &String
Trait Implementations§
source§impl Clone for VertexProperty
impl Clone for VertexProperty
source§fn clone(&self) -> VertexProperty
fn clone(&self) -> VertexProperty
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for VertexProperty
impl Debug for VertexProperty
source§impl From<VertexProperty> for GValue
impl From<VertexProperty> for GValue
source§fn from(val: VertexProperty) -> Self
fn from(val: VertexProperty) -> Self
Converts to this type from the input type.
source§impl PartialEq for VertexProperty
impl PartialEq for VertexProperty
source§fn eq(&self, other: &VertexProperty) -> bool
fn eq(&self, other: &VertexProperty) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for VertexProperty
Auto Trait Implementations§
impl Freeze for VertexProperty
impl RefUnwindSafe for VertexProperty
impl Send for VertexProperty
impl Sync for VertexProperty
impl Unpin for VertexProperty
impl UnwindSafe for VertexProperty
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