pub struct Dsn { /* private fields */ }Expand description
Parsed DSN (Data Source Name) for Geode connections.
Contains all connection parameters extracted from a DSN string.
Implementations§
Source§impl Dsn
impl Dsn
Sourcepub fn parse(dsn: &str) -> Result<Self>
pub fn parse(dsn: &str) -> Result<Self>
Parse a DSN string into a Dsn struct.
§Supported formats
quic://host:port?options- QUIC transport (recommended)grpc://host:port?options- gRPC transporthost:port?options- Defaults to QUIC
§Supported options (query parameters)
tls- Enable/disable TLS (0/1/true/false, default: true)insecure,skip_verify,insecure_skip_verify- Skip TLS verificationpage_size- Results page size (default: 1000)client_nameorhello_name- Client nameclient_versionorhello_ver- Client versionconformance- GQL conformance levelusernameoruser- Authentication usernamepasswordorpass- Authentication passwordcaorca_cert- Path to CA certificatecertorclient_cert- Path to client certificate (mTLS)keyorclient_key- Path to client key (mTLS)server_name- SNI server nameconnect_timeoutortimeout- Connection timeout in seconds
§Errors
Returns Error::InvalidDsn if:
- DSN is empty
- Scheme is unsupported
- Host is missing
- Port is invalid
§Examples
use geode_client::dsn::Dsn;
let dsn = Dsn::parse("quic://localhost:3141").unwrap();
let dsn = Dsn::parse("grpc://127.0.0.1:50051?tls=0").unwrap();
let dsn = Dsn::parse("grpc://[::1]:50051").unwrap();Sourcepub fn tls_enabled(&self) -> bool
pub fn tls_enabled(&self) -> bool
Check if TLS is enabled.
Sourcepub fn skip_verify(&self) -> bool
pub fn skip_verify(&self) -> bool
Check if TLS verification should be skipped.
Sourcepub fn client_name(&self) -> &str
pub fn client_name(&self) -> &str
Get the client name.
Sourcepub fn client_version(&self) -> &str
pub fn client_version(&self) -> &str
Get the client version.
Sourcepub fn conformance(&self) -> &str
pub fn conformance(&self) -> &str
Get the conformance level.
Sourcepub fn client_cert(&self) -> Option<&str>
pub fn client_cert(&self) -> Option<&str>
Get the client certificate path if specified.
Sourcepub fn client_key(&self) -> Option<&str>
pub fn client_key(&self) -> Option<&str>
Get the client key path if specified.
Sourcepub fn server_name(&self) -> Option<&str>
pub fn server_name(&self) -> Option<&str>
Get the SNI server name if specified.
Sourcepub fn connect_timeout_secs(&self) -> Option<u64>
pub fn connect_timeout_secs(&self) -> Option<u64>
Get the connection timeout in seconds if specified.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dsn
impl RefUnwindSafe for Dsn
impl Send for Dsn
impl Sync for Dsn
impl Unpin for Dsn
impl UnwindSafe for Dsn
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request