pub struct Opts(/* private fields */);Expand description
Connection options for VoltDB client.
This struct encapsulates all configuration options needed to establish
connections to a VoltDB cluster. Use Opts::builder() for a fluent
configuration API or Opts::new() for simple configurations.
§Example
use voltdb_client_rust::{Opts, IpPort};
// Simple configuration
let hosts = vec![IpPort::new("localhost".to_string(), 21212)];
let opts = Opts::new(hosts);
// Or use the builder for more options
let opts = Opts::builder()
.host("localhost", 21212)
.user("admin")
.password("secret")
.build()
.unwrap();Implementations§
Source§impl Opts
impl Opts
Sourcepub fn new(hosts: Vec<IpPort>) -> Opts
pub fn new(hosts: Vec<IpPort>) -> Opts
Creates connection options with the given hosts and default settings.
This is a convenience constructor for simple configurations without
authentication or timeouts. For more control, use Opts::builder().
§Arguments
hosts- List of VoltDB server endpoints to connect to
Sourcepub fn builder() -> OptsBuilder
pub fn builder() -> OptsBuilder
Creates a new OptsBuilder for fluent configuration.
§Example
use voltdb_client_rust::Opts;
use std::time::Duration;
let opts = Opts::builder()
.host("localhost", 21212)
.connect_timeout(Duration::from_secs(5))
.build()
.unwrap();Trait Implementations§
impl Eq for Opts
impl StructuralPartialEq for Opts
Auto Trait Implementations§
impl Freeze for Opts
impl RefUnwindSafe for Opts
impl Send for Opts
impl Sync for Opts
impl Unpin for Opts
impl UnwindSafe for Opts
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