pub struct Selector { /* private fields */ }Expand description
A registry of candidate engines; selection connects and returns a Client.
Implementations§
Source§impl Selector
impl Selector
pub fn new() -> Selector
Sourcepub fn load(path: &str) -> Result<Selector, RcpError>
pub fn load(path: &str) -> Result<Selector, RcpError>
Build a Selector from a registry JSON file.
Sourcepub fn loads(text: &str) -> Result<Selector, RcpError>
pub fn loads(text: &str) -> Result<Selector, RcpError>
Build a Selector from a registry JSON string ({"engines": [ ... ]}).
pub fn add_stdio(&mut self, id: &str, argv: &[&str], priority: i64) -> &mut Self
pub fn add_http(&mut self, id: &str, url: &str, priority: i64) -> &mut Self
pub fn size(&self) -> usize
Sourcepub fn select(&self, id: &str) -> Result<Client, RcpError>
pub fn select(&self, id: &str) -> Result<Client, RcpError>
Connect the engine with the given id (or error if unknown).
Sourcepub fn select_primary(&self) -> Result<Client, RcpError>
pub fn select_primary(&self) -> Result<Client, RcpError>
Connect the highest-priority engine that answers (liveness fallback).
Sourcepub fn select_capable(&self, cap: Capability) -> Result<Client, RcpError>
pub fn select_capable(&self, cap: Capability) -> Result<Client, RcpError>
Connect the highest-priority engine that answers AND advertises cap.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnsafeUnpin for Selector
impl UnwindSafe for Selector
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
Mutably borrows from an owned value. Read more