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§
Sourcefn topology(&self) -> Result<Value, RailError>
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.
Sourcefn request(
&self,
subject: &str,
input: &Value,
reply: bool,
) -> Result<Option<Value>, RailError>
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.
Sourcefn pass_for(&self, audience: &str) -> Result<String, RailError>
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.
Sourcefn tap(&self, channel: &str) -> Result<TapSubscription, RailError>
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.
Sourcefn server_address(&self) -> &str
fn server_address(&self) -> &str
The configured server address used to identify notification records.
Sourcefn request_bytes(&self) -> usize
fn request_bytes(&self) -> usize
The largest request body the rail sends.
Sourcefn flow_steps(&self) -> usize
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".