pub enum ShellValue {
Str(String),
Raw(String),
Number(f64),
BigInt(String),
Bool(bool),
Null,
Undefined,
Array(Vec<ShellValue>),
Bytes(Vec<u8>),
OutBuffer(OutBuffer),
}Expand description
An interpolated template value (the JavaScript value kinds that Bun Shell
accepts, minus the JS-only Response/Blob/Bun.file objects).
Variants§
Str(String)
A string; it is escaped (quoted) when it contains special characters.
Raw(String)
{ raw: "..." }: spliced into the script source unescaped.
Number(f64)
A JS number (stringified like JavaScript’s String(n)).
BigInt(String)
A JS bigint, given as its decimal digits.
Bool(bool)
Null
Undefined
Array(Vec<ShellValue>)
An array: each element becomes a separate word (nested arrays flatten).
Bytes(Vec<u8>)
A byte buffer used as input (< ${bytes}).
OutBuffer(OutBuffer)
An output buffer (> ${buf}).
Trait Implementations§
Source§impl Clone for ShellValue
impl Clone for ShellValue
Source§impl Debug for ShellValue
impl Debug for ShellValue
Source§impl From<&Path> for ShellValue
impl From<&Path> for ShellValue
Source§impl From<&String> for ShellValue
impl From<&String> for ShellValue
Source§impl From<&str> for ShellValue
impl From<&str> for ShellValue
Source§impl From<OutBuffer> for ShellValue
impl From<OutBuffer> for ShellValue
Source§impl From<PathBuf> for ShellValue
impl From<PathBuf> for ShellValue
Source§impl From<String> for ShellValue
impl From<String> for ShellValue
Source§impl<T: Into<ShellValue>> From<Vec<T>> for ShellValue
impl<T: Into<ShellValue>> From<Vec<T>> for ShellValue
Source§impl From<bool> for ShellValue
impl From<bool> for ShellValue
Source§impl From<f32> for ShellValue
impl From<f32> for ShellValue
Source§impl From<f64> for ShellValue
impl From<f64> for ShellValue
Source§impl From<i8> for ShellValue
impl From<i8> for ShellValue
Source§impl From<i16> for ShellValue
impl From<i16> for ShellValue
Source§impl From<i32> for ShellValue
impl From<i32> for ShellValue
Source§impl From<i64> for ShellValue
impl From<i64> for ShellValue
Source§impl From<isize> for ShellValue
impl From<isize> for ShellValue
Source§impl From<u8> for ShellValue
impl From<u8> for ShellValue
Source§impl From<u16> for ShellValue
impl From<u16> for ShellValue
Source§impl From<u32> for ShellValue
impl From<u32> for ShellValue
Source§impl From<u64> for ShellValue
impl From<u64> for ShellValue
Auto Trait Implementations§
impl Freeze for ShellValue
impl RefUnwindSafe for ShellValue
impl Send for ShellValue
impl Sync for ShellValue
impl Unpin for ShellValue
impl UnsafeUnpin for ShellValue
impl UnwindSafe for ShellValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&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> DowncastSync for T
impl<T> DowncastSync for T
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 more