Trait soroban_env_guest::EnvBase
source · [−]pub trait EnvBase: Clone {
fn as_mut_any(&mut self) -> &mut (dyn Any + 'static);
fn check_same_env(&self, other: &Self);
fn deep_clone(&self) -> Self;
fn binary_copy_from_slice(
&self,
b: Object,
b_pos: RawVal,
mem: &[u8]
) -> Object;
fn binary_copy_to_slice(&self, b: Object, b_pos: RawVal, mem: &mut [u8]);
fn binary_new_from_slice(&self, mem: &[u8]) -> Object;
fn log_static_fmt_val(&self, fmt: &'static str, v: RawVal);
fn log_static_fmt_static_str(&self, fmt: &'static str, s: &'static str);
fn log_static_fmt_val_static_str(
&self,
fmt: &'static str,
v: RawVal,
s: &'static str
);
fn log_static_fmt_general(
&self,
fmt: &'static str,
vals: &[RawVal],
strs: &[&'static str]
);
}
Expand description
Base trait extended by the Env trait, providing various special-case functions that do not simply call across cross the guest/host interface.
Required Methods
fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
Used for recovering the concrete type of the Host.
fn check_same_env(&self, other: &Self)
fn check_same_env(&self, other: &Self)
Used to check two environments are the same, trapping if not.
fn deep_clone(&self) -> Self
fn deep_clone(&self) -> Self
Used to clone an environment deeply, not just a handle to it.
Copy a slice of bytes from the caller’s memory into an existing Binary
object the host, returning a new Binary
.
fn binary_copy_to_slice(&self, b: Object, b_pos: RawVal, mem: &mut [u8])
fn binary_copy_to_slice(&self, b: Object, b_pos: RawVal, mem: &mut [u8])
Copy a slice of bytes from a Binary
in the host into the caller’s memory.
fn binary_new_from_slice(&self, mem: &[u8]) -> Object
fn binary_new_from_slice(&self, mem: &[u8]) -> Object
For a new Binary
in the host from a slice of memory in the caller.
fn log_static_fmt_val(&self, fmt: &'static str, v: RawVal)
fn log_static_fmt_val(&self, fmt: &'static str, v: RawVal)
Log a formatted debugging message to the debug log (if present), passing
a simplified format string (supporting only positional {}
markers) and
a single RawVal argument that will be inserted at the marker in the
format string.
fn log_static_fmt_static_str(&self, fmt: &'static str, s: &'static str)
fn log_static_fmt_static_str(&self, fmt: &'static str, s: &'static str)
Log a formatted debugging message to the debug log (if present), passing
a simplified format string (supporting only positional {}
markers) and
a single string-slice argument that will be inserted at the marker in
the format string.
fn log_static_fmt_val_static_str(
&self,
fmt: &'static str,
v: RawVal,
s: &'static str
)
fn log_static_fmt_val_static_str(
&self,
fmt: &'static str,
v: RawVal,
s: &'static str
)
Log a formatted debugging message to the debug log (if present), passing
a simplified format string (supporting only positional {}
markers) and
both a RawVal and a string-slice argument, that will each be inserted
at markers in the format string.
fn log_static_fmt_general(
&self,
fmt: &'static str,
vals: &[RawVal],
strs: &[&'static str]
)
fn log_static_fmt_general(
&self,
fmt: &'static str,
vals: &[RawVal],
strs: &[&'static str]
)
Log a formatted debugging message to the debug log (if present), passing
a simplified format string (supporting only positional {}
markers) and
both a slice of RawVals and a slice of string-slice argument, that
will be sequentially inserted at markers in the format string.