pub struct BasicBag;Trait Implementations§
Source§impl ConstantBag for BasicBag
impl ConstantBag for BasicBag
type Constant = ConstantData
fn make_constant<C>(
&self,
constant: BorrowedConstant<'_, C>,
) -> <BasicBag as ConstantBag>::Constantwhere
C: Constant,
fn make_int(&self, value: BigInt) -> <BasicBag as ConstantBag>::Constant
fn make_tuple( &self, elements: impl Iterator<Item = <BasicBag as ConstantBag>::Constant>, ) -> <BasicBag as ConstantBag>::Constant
fn make_code( &self, code: CodeObject<<BasicBag as ConstantBag>::Constant>, ) -> <BasicBag as ConstantBag>::Constant
fn make_name( &self, name: &str, ) -> <<BasicBag as ConstantBag>::Constant as Constant>::Name
impl Copy for BasicBag
Auto Trait Implementations§
impl Freeze for BasicBag
impl RefUnwindSafe for BasicBag
impl Send for BasicBag
impl Sync for BasicBag
impl Unpin for BasicBag
impl UnsafeUnpin for BasicBag
impl UnwindSafe for BasicBag
Blanket Implementations§
Source§impl<Bag> AsBag for Bagwhere
Bag: ConstantBag,
impl<Bag> AsBag for Bagwhere
Bag: ConstantBag,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Helper for T
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
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<Bag> MarshalBag for Bagwhere
Bag: ConstantBag,
impl<Bag> MarshalBag for Bagwhere
Bag: ConstantBag,
type Value = <Bag as ConstantBag>::Constant
type ConstantBag = Bag
fn make_bool(&self, value: bool) -> <Bag as MarshalBag>::Value
fn make_none(&self) -> <Bag as MarshalBag>::Value
fn make_ellipsis(&self) -> <Bag as MarshalBag>::Value
fn make_float(&self, value: f64) -> <Bag as MarshalBag>::Value
fn make_complex(&self, value: Complex<f64>) -> <Bag as MarshalBag>::Value
fn make_str(&self, value: &Wtf8) -> <Bag as MarshalBag>::Value
fn make_bytes(&self, value: &[u8]) -> <Bag as MarshalBag>::Value
fn make_int(&self, value: BigInt) -> <Bag as MarshalBag>::Value
fn make_tuple( &self, elements: impl Iterator<Item = <Bag as MarshalBag>::Value>, ) -> <Bag as MarshalBag>::Value
fn make_slice( &self, start: <Bag as MarshalBag>::Value, stop: <Bag as MarshalBag>::Value, step: <Bag as MarshalBag>::Value, ) -> Result<<Bag as MarshalBag>::Value, MarshalError>
fn make_code( &self, code: CodeObject<<<Bag as MarshalBag>::ConstantBag as ConstantBag>::Constant>, ) -> Result<<Bag as MarshalBag>::Value, MarshalError>
fn make_stop_iter(&self) -> Result<<Bag as MarshalBag>::Value, MarshalError>
fn make_list( &self, _: impl Iterator<Item = <Bag as MarshalBag>::Value>, ) -> Result<<Bag as MarshalBag>::Value, MarshalError>
fn make_set( &self, _: impl Iterator<Item = <Bag as MarshalBag>::Value>, ) -> Result<<Bag as MarshalBag>::Value, MarshalError>
fn make_frozenset( &self, it: impl Iterator<Item = <Bag as MarshalBag>::Value>, ) -> Result<<Bag as MarshalBag>::Value, MarshalError>
fn make_dict( &self, _: impl Iterator<Item = (<Bag as MarshalBag>::Value, <Bag as MarshalBag>::Value)>, ) -> Result<<Bag as MarshalBag>::Value, MarshalError>
fn constant_bag(self) -> <Bag as MarshalBag>::ConstantBag
fn constant_ref_from_value( &self, value: &<Bag as MarshalBag>::Value, ) -> Option<<<Bag as MarshalBag>::ConstantBag as ConstantBag>::Constant>
fn bytes_from_value( &self, value: &<Bag as MarshalBag>::Value, ) -> Option<Vec<u8>>
fn str_from_value(&self, value: &<Bag as MarshalBag>::Value) -> Option<String>
fn tuple_elements_from_value( &self, value: &<Bag as MarshalBag>::Value, ) -> Option<Vec<<Bag as MarshalBag>::Value>>
fn make_interned_str(&self, value: &Wtf8) -> Self::Value
Source§fn make_code_with_constants(
&self,
code: CodeObject<<Self::ConstantBag as ConstantBag>::Constant>,
_constants: Vec<Self::Value>,
) -> Result<Self::Value, MarshalError>
fn make_code_with_constants( &self, code: CodeObject<<Self::ConstantBag as ConstantBag>::Constant>, _constants: Vec<Self::Value>, ) -> Result<Self::Value, MarshalError>
Construct a runtime code object while retaining the exact values read
from
co_consts. Compiler bags ignore this second channel; runtime
bags use it for marshalable values (lists, dicts, sets, recursive
containers) that their compiler constant representation cannot hold.Source§fn code_units_from_bytes(
&self,
code_bytes: &[u8],
) -> Result<CodeUnits, MarshalError>
fn code_units_from_bytes( &self, code_bytes: &[u8], ) -> Result<CodeUnits, MarshalError>
Decode the public
co_code byte string into the execution-oriented
instruction storage. Read moreSource§fn make_code_with_constants_and_bytes(
&self,
code: CodeObject<<Self::ConstantBag as ConstantBag>::Constant>,
constants: Vec<Self::Value>,
_code_bytes: Vec<u8>,
) -> Result<Self::Value, MarshalError>
fn make_code_with_constants_and_bytes( &self, code: CodeObject<<Self::ConstantBag as ConstantBag>::Constant>, constants: Vec<Self::Value>, _code_bytes: Vec<u8>, ) -> Result<Self::Value, MarshalError>
Construct a runtime code object while retaining both its exact public
co_code bytes and the exact values read from co_consts. Read moreSource§fn make_tuple_placeholder(
&self,
_len: usize,
) -> Result<Option<Self::Value>, MarshalError>
fn make_tuple_placeholder( &self, _len: usize, ) -> Result<Option<Self::Value>, MarshalError>
Install partially-built containers in the marshal reference table
before reading their children, as CPython’s
r_object() does.
Runtime bags can opt in; constant bags retain collect-then-construct. Read morefn set_tuple_item( &self, _tuple: &Self::Value, _index: usize, _value: Self::Value, ) -> Result<(), MarshalError>
fn make_list_placeholder( &self, _len: usize, ) -> Result<Option<Self::Value>, MarshalError>
fn set_list_item( &self, _list: &Self::Value, _index: usize, _value: Self::Value, ) -> Result<(), MarshalError>
fn make_set_placeholder(&self) -> Option<Self::Value>
fn insert_set_item( &self, _set: &Self::Value, _value: Self::Value, ) -> Result<(), MarshalError>
fn make_dict_placeholder(&self) -> Option<Self::Value>
fn insert_dict_item( &self, _dict: &Self::Value, _key: Self::Value, _value: Self::Value, ) -> Result<(), MarshalError>
Source§fn code_constant_from_value(
&self,
value: &Self::Value,
) -> Result<<Self::ConstantBag as ConstantBag>::Constant, MarshalError>
fn code_constant_from_value( &self, value: &Self::Value, ) -> Result<<Self::ConstantBag as ConstantBag>::Constant, MarshalError>
Convert a runtime constant to the compiler-side shape stored in
CodeObject. Runtime implementations may return a semantically
unused placeholder when the exact value is carried by
make_code_with_constants instead.