Struct gremlin_client::ConnectionOptionsBuilder
source · pub struct ConnectionOptionsBuilder(/* private fields */);
Implementations§
source§impl ConnectionOptionsBuilder
impl ConnectionOptionsBuilder
sourcepub fn host<T>(self, host: T) -> Self
pub fn host<T>(self, host: T) -> Self
Examples found in repository?
examples/connection_options.rs (line 6)
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(())
}
sourcepub fn port(self, port: u16) -> Self
pub fn port(self, port: u16) -> Self
Examples found in repository?
examples/connection_options.rs (line 7)
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(())
}
sourcepub fn pool_size(self, pool_size: u32) -> Self
pub fn pool_size(self, pool_size: u32) -> Self
Examples found in repository?
examples/connection_options.rs (line 8)
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(())
}
sourcepub fn build(self) -> ConnectionOptions
pub fn build(self) -> ConnectionOptions
Examples found in repository?
examples/connection_options.rs (line 10)
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(())
}
sourcepub fn credentials(self, username: &str, password: &str) -> Self
pub fn credentials(self, username: &str, password: &str) -> Self
Examples found in repository?
examples/connection_options.rs (line 9)
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 ssl(self, ssl: bool) -> Self
pub fn tls_options(self, options: TlsOptions) -> Self
pub fn websocket_options(self, options: WebSocketOptions) -> Self
pub fn serializer(self, serializer: GraphSON) -> Self
pub fn deserializer(self, deserializer: GraphSON) -> Self
Auto Trait Implementations§
impl Freeze for ConnectionOptionsBuilder
impl RefUnwindSafe for ConnectionOptionsBuilder
impl Send for ConnectionOptionsBuilder
impl Sync for ConnectionOptionsBuilder
impl Unpin for ConnectionOptionsBuilder
impl UnwindSafe for ConnectionOptionsBuilder
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