Struct gremlin_client::ConnectionOptions
source · pub struct ConnectionOptions { /* private fields */ }
Implementations§
source§impl ConnectionOptions
impl ConnectionOptions
sourcepub fn builder() -> ConnectionOptionsBuilder
pub fn builder() -> ConnectionOptionsBuilder
Examples found in repository?
examples/connection_options.rs (line 5)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = GremlinClient::connect(
ConnectionOptions::builder()
.host("localhost")
.port(8182)
.pool_size(1)
.credentials("stephen", "password")
.build(),
)?;
let results = client
.execute("g.V(param)", &[("param", &1)])?
.filter_map(Result::ok)
.map(|f| f.take::<Vertex>())
.collect::<Result<Vec<Vertex>, _>>()?;
println!("{:?}", results);
Ok(())
}
pub fn websocket_url(&self) -> String
Trait Implementations§
source§impl Clone for ConnectionOptions
impl Clone for ConnectionOptions
source§fn clone(&self) -> ConnectionOptions
fn clone(&self) -> ConnectionOptions
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 ConnectionOptions
impl Debug for ConnectionOptions
source§impl Default for ConnectionOptions
impl Default for ConnectionOptions
source§fn default() -> ConnectionOptions
fn default() -> ConnectionOptions
Returns the “default value” for a type. Read more
source§impl Into<ConnectionOptions> for &str
impl Into<ConnectionOptions> for &str
source§fn into(self) -> ConnectionOptions
fn into(self) -> ConnectionOptions
Converts this type into the (usually inferred) input type.
source§impl Into<ConnectionOptions> for (&str, u16)
impl Into<ConnectionOptions> for (&str, u16)
source§fn into(self) -> ConnectionOptions
fn into(self) -> ConnectionOptions
Converts this type into the (usually inferred) input type.
Auto Trait Implementations§
impl Freeze for ConnectionOptions
impl RefUnwindSafe for ConnectionOptions
impl Send for ConnectionOptions
impl Sync for ConnectionOptions
impl Unpin for ConnectionOptions
impl UnwindSafe for ConnectionOptions
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