pub enum Source {
Local(PathBuf),
Remote(String),
}Variants§
Local(PathBuf)
A block directory, read in-process.
Remote(String)
host:port of a running Mira’s HTTP listener.
Implementations§
Source§impl Source
impl Source
pub fn label(&self) -> String
Sourcepub fn post(&self, route: &str, body: &str) -> Result<Yaml, String>
pub fn post(&self, route: &str, body: &str) -> Result<Yaml, String>
Run one query and hand back the parsed envelope.
Errors are String because every one of them ends up in the status bar
verbatim. A TUI that reports “query failed” and keeps the reason to
itself is worse than no TUI.
Sourcepub fn get(&self, route: &str) -> Result<Yaml, String>
pub fn get(&self, route: &str) -> Result<Yaml, String>
Fetch one of the process-scoped documents.
Separate from Source::post rather than a route arm inside it because
the local case is not “a route this transport does not implement” — it is
that the thing being asked about does not exist. A block directory is
readable without a server, which is the point of the local source; a node
that is not running has no counters and is not paging anyone.
fn envelope(text: &str) -> Result<Yaml, String>
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].