pub enum ServerAddress {
Show 20 variants
Local,
InProcess {
thread: u64,
},
Coroutine {
id: u64,
},
Tcp {
host: String,
port: u16,
},
Unix {
path: PathBuf,
},
Wasm {
region: String,
},
Http {
url: String,
},
Ws {
url: String,
},
Sse {
url: String,
},
Smtp {
address: String,
},
Imap {
address: String,
mailbox: String,
},
Telegram {
chat_id: String,
bot: String,
},
Matrix {
room_id: String,
},
Stdin,
FileTail {
path: PathBuf,
},
Cron {
spec: String,
},
Webhook {
route: String,
},
Agent {
agent: String,
},
Pipeline {
steps: Vec<ServerAddress>,
},
Any,
}Expand description
Location of a SIM server endpoint, parsed from an address expression.
Identifies where eval/agent traffic is served – in-process, over a transport, through an integration, or as a pipeline of stages.
Variants§
Local
The current process; no transport is involved.
InProcess
A peer thread within the same process.
Coroutine
A coroutine within the local scheduler.
Tcp
A TCP endpoint.
Unix
A Unix domain socket.
Wasm
A wasm guest region.
Http
An HTTP endpoint.
Ws
A WebSocket endpoint.
Sse
A server-sent events endpoint.
Smtp
An SMTP mail endpoint.
Imap
An IMAP mailbox endpoint.
Telegram
A Telegram bot chat endpoint.
Matrix
A Matrix room endpoint.
Stdin
Standard input as a source.
FileTail
A file followed for appended lines.
Cron
A cron schedule that triggers serving.
Webhook
An inbound webhook route.
Agent
A named agent endpoint.
Pipeline
A sequence of addresses chained as stages.
Fields
steps: Vec<ServerAddress>Ordered stages making up the pipeline.
Any
A wildcard address matching any endpoint.
Implementations§
Source§impl ServerAddress
impl ServerAddress
Sourcepub fn is_remote_like(&self) -> bool
pub fn is_remote_like(&self) -> bool
Returns true when the address denotes a non-local endpoint.
Local and Any are local; a Pipeline is remote-like if any of its
stages is.
Sourcepub fn from_expr(expr: &Expr) -> Result<Self>
pub fn from_expr(expr: &Expr) -> Result<Self>
Parses a ServerAddress from an address expression.
A bare symbol selects local, stdin, or any; a list or vector is
read as a kind symbol followed by key/value option pairs.
Sourcepub fn kind_symbol(&self) -> Symbol
pub fn kind_symbol(&self) -> Symbol
Returns the symbol naming this address kind (e.g. tcp, pipeline).
Sourcepub fn as_value(&self, cx: &mut Cx) -> Result<Value>
pub fn as_value(&self, cx: &mut Cx) -> Result<Value>
Builds a runtime table value describing the address.
The table carries a kind entry plus one entry per field of the
variant; a Pipeline nests its stages as a list of such tables.
Sourcepub fn transport_available(&self) -> bool
pub fn transport_available(&self) -> bool
Returns true when a transport is implemented for this address kind.
Sourcepub fn ensure_transport_available(&self) -> Result<()>
pub fn ensure_transport_available(&self) -> Result<()>
Succeeds when a transport exists for this address, else returns an error.
Trait Implementations§
Source§impl Clone for ServerAddress
impl Clone for ServerAddress
Source§fn clone(&self) -> ServerAddress
fn clone(&self) -> ServerAddress
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerAddress
impl Debug for ServerAddress
impl Eq for ServerAddress
Source§impl PartialEq for ServerAddress
impl PartialEq for ServerAddress
impl StructuralPartialEq for ServerAddress
Auto Trait Implementations§
impl Freeze for ServerAddress
impl RefUnwindSafe for ServerAddress
impl Send for ServerAddress
impl Sync for ServerAddress
impl Unpin for ServerAddress
impl UnsafeUnpin for ServerAddress
impl UnwindSafe for ServerAddress
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.