Skip to main content

Rail

Trait Rail 

Source
pub trait Rail: Debug {
    // Required methods
    fn topology(&self) -> Result<Value, RailError>;
    fn request(
        &self,
        subject: &str,
        input: &Value,
        reply: bool,
    ) -> Result<Option<Value>, RailError>;
    fn pass_for(&self, audience: &str) -> Result<String, RailError>;
    fn tap(&self, channel: &str) -> Result<TapSubscription, RailError>;
    fn server_address(&self) -> &str;
    fn counts(&self) -> &Counts;
    fn request_bytes(&self) -> usize;
    fn flow_steps(&self) -> usize;
}
Expand description

The network as the tools see it.

Required Methods§

Source

fn topology(&self) -> Result<Value, RailError>

The current topology record, read fresh: one subscription, the first whole record, closed before returning.

§Errors

Returns the server’s refusal, an oversize record or no record.

Source

fn request( &self, subject: &str, input: &Value, reply: bool, ) -> Result<Option<Value>, RailError>

One request on subject; with reply the correlated reply’s JSON, without it None once sent.

§Errors

Returns the server’s refusal in its words.

Source

fn pass_for(&self, audience: &str) -> Result<String, RailError>

The calling seat’s own pass for audience, minted for a call that names pass_for; never the pass the rail’s connections present.

§Errors

Returns why no pass could be had, in words that carry no secret.

Source

fn tap(&self, channel: &str) -> Result<TapSubscription, RailError>

Opens a long-lived subscription on a tap channel using the seat pass.

§Errors

Returns the server’s refusal in its words.

Source

fn server_address(&self) -> &str

The configured server address used to identify notification records.

Source

fn counts(&self) -> &Counts

The counts so far.

Source

fn request_bytes(&self) -> usize

The largest request body the rail sends.

Source

fn flow_steps(&self) -> usize

The most steps one flow may carry.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§