pub struct Endpoint { /* private fields */ }Expand description
A Phoenix socket base URL and per-attempt connection configuration.
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub fn new(url: impl AsRef<str>) -> Result<Self, EndpointError>
pub fn new(url: impl AsRef<str>) -> Result<Self, EndpointError>
Parses a ws or wss Phoenix socket URL.
/websocket is appended when the supplied path does not already end
with it.
Sourcepub fn connection_config(self, config: ConnectionConfig) -> Self
pub fn connection_config(self, config: ConnectionConfig) -> Self
Uses a static connection configuration for every attempt.
Sourcepub fn connection_config_loader(self, loader: ConnectionConfigLoader) -> Self
pub fn connection_config_loader(self, loader: ConnectionConfigLoader) -> Self
Installs a loader that is evaluated for every connection attempt.
Sourcepub async fn resolve(
&self,
context: ConnectContext,
) -> Result<ResolvedEndpoint, EndpointError>
pub async fn resolve( &self, context: ConnectContext, ) -> Result<ResolvedEndpoint, EndpointError>
Resolves query parameters, protocol version, and authentication protocols.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Endpoint
impl !RefUnwindSafe for Endpoint
impl !Send for Endpoint
impl !Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
impl !UnwindSafe for Endpoint
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