pub struct NamedToolProbe { /* private fields */ }Expand description
An operator-declared named tool probe: a FIXED argv, written in worker configuration, run as the configured remote user.
The argv is never caller-supplied. RCH deliberately exposes no general remote-shell probe API: a build that could ask a worker to run an arbitrary command “to check for a tool” would be a remote execution primitive wearing a capability-probe hat. Declaring the argv in operator config keeps the set of commands a worker will run for a probe finite and reviewable.
Verification is by EXIT STATUS: zero means present, anything else — missing binary, error exit, signal — means absent. Output is discarded so a chatty tool cannot corrupt the fact stream.
Implementations§
Source§impl NamedToolProbe
impl NamedToolProbe
Sourcepub fn new(
name: impl Into<String>,
command: impl IntoIterator<Item = impl Into<String>>,
) -> Result<Self, ToolProbeError>
pub fn new( name: impl Into<String>, command: impl IntoIterator<Item = impl Into<String>>, ) -> Result<Self, ToolProbeError>
Declare a probe, rejecting names that cannot round-trip the fact wire
format (RCH_FACT tool=<name>): a name containing =, whitespace or a
control character would be parsed back as a different name, which is a
silent capability lie rather than a loud config error.
§Errors
ToolProbeError when the name is unusable or the command is empty.
Trait Implementations§
Source§impl Clone for NamedToolProbe
impl Clone for NamedToolProbe
Source§impl Debug for NamedToolProbe
impl Debug for NamedToolProbe
impl Eq for NamedToolProbe
Source§impl PartialEq for NamedToolProbe
impl PartialEq for NamedToolProbe
impl StructuralPartialEq for NamedToolProbe
Source§impl TryFrom<&WorkerToolProbe> for NamedToolProbe
impl TryFrom<&WorkerToolProbe> for NamedToolProbe
Source§fn try_from(entry: &WorkerToolProbe) -> Result<Self, Self::Error>
fn try_from(entry: &WorkerToolProbe) -> Result<Self, Self::Error>
Validate a workers.toml entry. This is the single point where a
malformed declaration is refused, so a bad name fails config load
loudly rather than becoming a worker that quietly advertises nothing.
Source§type Error = ToolProbeError
type Error = ToolProbeError
Auto Trait Implementations§
impl Freeze for NamedToolProbe
impl RefUnwindSafe for NamedToolProbe
impl Send for NamedToolProbe
impl Sync for NamedToolProbe
impl Unpin for NamedToolProbe
impl UnsafeUnpin for NamedToolProbe
impl UnwindSafe for NamedToolProbe
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.