pub trait AblyRealtimeEdge {
// Required methods
fn publish(
&mut self,
channel: &str,
token: &str,
retained_at_ms: u64,
payload: &[u8],
) -> Result<String, AblyEdgeError>;
fn history_from(
&mut self,
channel: &str,
token: &str,
cursor: Option<&str>,
now_ms: u64,
replay_window_ms: u64,
) -> Result<AblyHistoryBatch, AblyEdgeError>;
fn set_available(&mut self, available: bool);
}Expand description
Injectable Ably edge so the optional adapter stays replaceable and testable.
Required Methods§
Sourcefn publish(
&mut self,
channel: &str,
token: &str,
retained_at_ms: u64,
payload: &[u8],
) -> Result<String, AblyEdgeError>
fn publish( &mut self, channel: &str, token: &str, retained_at_ms: u64, payload: &[u8], ) -> Result<String, AblyEdgeError>
Publishes ciphertext to a provider-native channel using a scoped token.
§Errors
Returns AblyEdgeError when auth fails or the edge is unavailable.
Sourcefn history_from(
&mut self,
channel: &str,
token: &str,
cursor: Option<&str>,
now_ms: u64,
replay_window_ms: u64,
) -> Result<AblyHistoryBatch, AblyEdgeError>
fn history_from( &mut self, channel: &str, token: &str, cursor: Option<&str>, now_ms: u64, replay_window_ms: u64, ) -> Result<AblyHistoryBatch, AblyEdgeError>
Returns ordered history after cursor for the provider channel.
§Errors
Returns AblyEdgeError on auth/outage failures. Expired cursors use
AblyEdgeError::CursorExpired.
Sourcefn set_available(&mut self, available: bool)
fn set_available(&mut self, available: bool)
Marks the edge available or unavailable.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".