#[non_exhaustive]pub enum BuiltInConnectionString {
Http(Url),
Ws(Url, Option<Authorization>),
Ipc(PathBuf),
}
Expand description
Connection string for built-in transports.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Http(Url)
Available on crate features
reqwest
or hyper
only.HTTP transport.
Ws(Url, Option<Authorization>)
Available on crate feature
ws
only.WebSocket transport.
Ipc(PathBuf)
Available on crate feature
ipc
only.IPC transport.
Implementations§
source§impl BuiltInConnectionString
impl BuiltInConnectionString
sourcepub async fn connect_boxed(&self) -> Result<BoxTransport, TransportError>
pub async fn connect_boxed(&self) -> Result<BoxTransport, TransportError>
Connect with the given connection string.
§Notes
- If
hyper
feature is enabled - WS will extract auth, however, auth is disabled for wasm.
sourcepub fn try_as_http(s: &str) -> Result<Self, TransportError>
Available on crate features reqwest
or hyper
only.
pub fn try_as_http(s: &str) -> Result<Self, TransportError>
reqwest
or hyper
only.Tries to parse the given string as an HTTP URL.
sourcepub fn try_as_ws(s: &str) -> Result<Self, TransportError>
Available on crate feature ws
only.
pub fn try_as_ws(s: &str) -> Result<Self, TransportError>
ws
only.Tries to parse the given string as a WebSocket URL.
sourcepub fn try_as_ipc(s: &str) -> Result<Self, TransportError>
Available on crate feature ipc
only.
pub fn try_as_ipc(s: &str) -> Result<Self, TransportError>
ipc
only.Tries to parse the given string as an IPC path, returning an error if the path does not exist.
Trait Implementations§
source§impl BoxTransportConnect for BuiltInConnectionString
impl BoxTransportConnect for BuiltInConnectionString
source§fn get_boxed_transport<'a: 'b, 'b>(
&'a self,
) -> Pbf<'b, BoxTransport, TransportError>
fn get_boxed_transport<'a: 'b, 'b>( &'a self, ) -> Pbf<'b, BoxTransport, TransportError>
Connect to a transport, and box it.
source§impl Clone for BuiltInConnectionString
impl Clone for BuiltInConnectionString
source§fn clone(&self) -> BuiltInConnectionString
fn clone(&self) -> BuiltInConnectionString
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 BuiltInConnectionString
impl Debug for BuiltInConnectionString
source§impl FromStr for BuiltInConnectionString
impl FromStr for BuiltInConnectionString
source§impl PartialEq for BuiltInConnectionString
impl PartialEq for BuiltInConnectionString
impl Eq for BuiltInConnectionString
impl StructuralPartialEq for BuiltInConnectionString
Auto Trait Implementations§
impl Freeze for BuiltInConnectionString
impl RefUnwindSafe for BuiltInConnectionString
impl Send for BuiltInConnectionString
impl Sync for BuiltInConnectionString
impl Unpin for BuiltInConnectionString
impl UnwindSafe for BuiltInConnectionString
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.