Skip to main content

RemoteConfig

Struct RemoteConfig 

Source
pub struct RemoteConfig {
    pub server_address: ServerAddress,
    pub channel_name: String,
    pub conversation_id: ConversationId,
    pub pool_config: ConnectionPoolConfig,
    /* private fields */
}
Expand description

Configuration for remote SDK handles.

Fields§

§server_address: ServerAddress

Remote server address. Remote mode cannot be created without this value.

§channel_name: String

Application-visible channel name.

§conversation_id: ConversationId

Application-visible conversation identifier.

§pool_config: ConnectionPoolConfig

Caller/runtime-supplied connection pool configuration.

Implementations§

Source§

impl RemoteConfig

Source

pub fn read_wake(&self) -> Option<ReadWake>

The transport’s read wake, when it has one (the TCP transport on unix).

The wake is the transport’s, shared by every handle over it: it interrupts budgeted participant reads (receive_within, and the fence wait in try_receive) on any of them, and never the reply-owed receive or the transport’s own request/response exchanges. See ReadWake for exactly which reads.

Source

pub fn new( server_address: impl Into<String>, channel_name: impl Into<String>, conversation_id: impl Into<ConversationId>, pool_config: ConnectionPoolConfig, ) -> Result<Self, SdkError>

Creates remote configuration with a required server address and pool config.

The returned configuration is NOT connected. It carries a placeholder transport that owns no socket, and every publish, subscribe, conversation, and resume operation performed through it refuses with SdkError::NotConnected. Call connect_tcp, connect_tcp_with_auth, connect_websocket, connect_websocket_with_auth, or (with the embedded feature) connect_loopback to install a live transport first.

This is deliberate loudness. The placeholder used to encode each frame, discard it, and return a synthesised Accept, so a caller who forgot to connect saw nothing but green results for messages that reached no wire.

§Errors

Returns SdkError if the address or pool configuration is invalid.

Source

pub fn connect_tcp(self) -> Result<Self, SdkError>

Opens a real TCP connection to the configured server and installs the live wire transport, replacing the in-process protocol transport.

This performs the protocol handshake (Connect -> ConnectAck) eagerly, so a returned configuration is already connected to the server. Subsequent publish, subscribe, and conversation calls traverse the socket.

§Errors

Returns SdkError::Connection when the TCP connection cannot be established and SdkError::Protocol when the handshake is rejected.

Source

pub fn connect_tcp_with_auth(self, auth_token: &[u8]) -> Result<Self, SdkError>

Opens a real TCP connection whose handshake carries auth_token, for a server gated by an [auth] section, and installs the live wire transport.

Additive to connect_tcp: an empty token behaves identically to it. The server compares the token during the handshake and closes the connection on a mismatch, which surfaces here as SdkError::Connection.

§Errors

Returns SdkError::Connection when the TCP connection cannot be established or the token is rejected, and SdkError::Protocol when the handshake frames cannot be encoded or sent.

Source

pub fn connect_websocket(self) -> Result<Self, SdkError>

Opens a real WebSocket connection to the configured ws:// server address and installs the live wire transport, replacing the in-process protocol transport.

This performs the WebSocket upgrade and the protocol handshake (Connect -> ConnectAck) eagerly through the client unit’s typed permit path, so a returned configuration is already connected. Subsequent publish, subscribe, and conversation calls traverse the socket; the concretely typed transport stays reachable through websocket_transport for the typed reconnect path.

§Errors

Returns SdkError::Connection when the address is not a usable ws:// URL, the connection cannot be established, or the handshake is rejected, and SdkError::Protocol when frames cannot be encoded.

Source

pub fn connect_websocket_with_auth( self, auth_token: &[u8], ) -> Result<Self, SdkError>

Opens a real WebSocket connection whose handshake carries auth_token, for a server gated by an [auth] section, and installs the live wire transport. Additive to connect_websocket: an empty token behaves identically to it.

§Errors

Returns SdkError::Connection when the connection cannot be established or the token is rejected, and SdkError::Protocol when the handshake frames cannot be encoded or sent.

Source

pub fn websocket_transport(&self) -> Option<Arc<WebSocketRemoteTransport>>

The concretely typed WebSocket transport installed by connect_websocket, when one is installed.

Trait Implementations§

Source§

impl Clone for RemoteConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RemoteConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more