Skip to main content

ChannelUri

Struct ChannelUri 

Source
pub struct ChannelUri {}
Expand description

Represents the Aeron URI parser and handler.

Implementations§

Source§

impl ChannelUri

Source

pub const AERON_SCHEME: &'static str = "aeron"

Source

pub const SPY_QUALIFIER: &'static str = "aeron-spy"

Source

pub const MAX_URI_LENGTH: usize = 4095

Source

pub fn add_session_id(channel: &str, session_id: i32) -> String

Return channel with a session-id param added (replacing any existing one).

Mirrors Java’s ChannelUri.addSessionId — the standard way to build a channel that joins a specific session, e.g. when subscribing to an archive replay:

assert_eq!(
    ChannelUri::add_session_id("aeron:ipc", 42),
    "aeron:ipc?session-id=42"
);
assert_eq!(
    ChannelUri::add_session_id("aeron:udp?endpoint=localhost:20121", -123),
    "aeron:udp?endpoint=localhost:20121|session-id=-123"
);
Source

pub fn set_param(channel: &str, key: &str, value: &str) -> String

Return channel with URI param key=value set, replacing an existing key param if present. Other params keep their relative order; key goes last.

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.