pub struct RealScriptIo;Expand description
The real I/O backend: blocking HTTP, host shell, filesystem, and env access.
Every method runs synchronously (the script engine is driven from a
spawn_blocking context), so a blocking reqwest client and std::process
are safe here.
Trait Implementations§
Source§impl ScriptIo for RealScriptIo
impl ScriptIo for RealScriptIo
Source§fn http_get(
&self,
url: &str,
headers: BTreeMap<String, String>,
) -> Result<String, String>
fn http_get( &self, url: &str, headers: BTreeMap<String, String>, ) -> Result<String, String>
Perform an HTTP GET, returning the response body (or an error message).
Source§fn http_post(
&self,
url: &str,
body: &str,
headers: BTreeMap<String, String>,
) -> Result<String, String>
fn http_post( &self, url: &str, body: &str, headers: BTreeMap<String, String>, ) -> Result<String, String>
Perform an HTTP POST, returning the response body (or an error message).
Source§fn run_shell(
&self,
cmd: TokioCommand,
timeout: Duration,
) -> Result<String, String>
fn run_shell( &self, cmd: TokioCommand, timeout: Duration, ) -> Result<String, String>
Run a prepared shell command (already sandbox-wrapped and pointed at the
workdir by the host), enforcing
timeout, and return its combined output.Source§fn read_file(&self, path: &Path) -> Result<String, String>
fn read_file(&self, path: &Path) -> Result<String, String>
Read the file at an already-confined absolute
path.Auto Trait Implementations§
impl Freeze for RealScriptIo
impl RefUnwindSafe for RealScriptIo
impl Send for RealScriptIo
impl Sync for RealScriptIo
impl Unpin for RealScriptIo
impl UnsafeUnpin for RealScriptIo
impl UnwindSafe for RealScriptIo
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.