#[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
hyperfeature 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 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
Source§impl TransportConnect for BuiltInConnectionString
impl TransportConnect for BuiltInConnectionString
Source§async fn get_transport(&self) -> Result<BoxTransport, TransportError>
async fn get_transport(&self) -> Result<BoxTransport, TransportError>
Connect to the transport, returning a
Transport instance.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§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.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> 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> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 88 bytes
Size for each variant:
Http: 76 bytesWs: 88 bytesIpc: 16 bytes