Struct cpclib_asm::assembler::Env
source · [−]pub struct Env { /* private fields */ }Expand description
Environment of the assembly
Implementations
sourceimpl Env
impl Env
Symbols handling
pub fn symbols(&self) -> &SymbolsTableCaseDependent
pub fn symbols_mut(&mut self) -> &mut SymbolsTableCaseDependent
sourcepub fn resolve_expr_may_fail_in_first_pass<E: ExprEvaluationExt>(
&self,
exp: &E
) -> Result<ExprResult, AssemblerError>
pub fn resolve_expr_may_fail_in_first_pass<E: ExprEvaluationExt>(
&self,
exp: &E
) -> Result<ExprResult, AssemblerError>
Compute the expression thanks to the symbol table of the environment. If the expression is not solvable in first pass, 0 is returned. If the expression is not solvable in second pass, an error is returned
However, when assembling in a crunched section, the expression MUST NOT fail. edit: why ? I do not get it now and I have removed this limitation
sourceimpl Env
impl Env
Error handling
sourcepub fn add_error_discardable_one_pass(
&mut self,
e: AssemblerError
) -> Result<(), AssemblerError>
pub fn add_error_discardable_one_pass(
&mut self,
e: AssemblerError
) -> Result<(), AssemblerError>
If the error has not been raised at the previous pass, store it and do not propagate it. Otherwise, propagate it
sourceimpl Env
impl Env
sourcepub fn with_table(symbols: &SymbolsTable) -> Self
pub fn with_table(symbols: &SymbolsTable) -> Self
Create an environment that embeds a copy of the given table and is configured to be in the latest pass. Mainly used for tests.
pub fn with_table_case_dependent(symbols: &SymbolsTableCaseDependent) -> Self
pub fn warnings(&self) -> &[AssemblerError]
sourceimpl Env
impl Env
Output handling
sourcepub fn logical_output_address(&self) -> u16
pub fn logical_output_address(&self) -> u16
Return the address where the next byte will be written
sourcepub fn logical_code_address(&self) -> u16
pub fn logical_code_address(&self) -> u16
Return the address of dollar
pub fn limit_address(&self) -> u16
pub fn start_address(&self) -> Option<u16>
pub fn maximum_address(&self) -> u16
sourcepub fn update_dollar(&mut self)
pub fn update_dollar(&mut self)
. Update the value of $ in the symbol table in order to take the current output address
sourcepub fn memory(&self, start: u16, size: u16) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn memory(&self, start: u16, size: u16) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Produce the memory for the required limits TODO check that the implementation is still correct with snapshot inclusion BUG does not take into account extra bank configuration
sourcepub fn produced_bytes(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn produced_bytes(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns the stream of bytes produced for a 64k compilation
sourcepub fn loading_address(&self) -> Option<u16>
pub fn loading_address(&self) -> Option<u16>
Returns the address of the 1st written byte
sourcepub fn execution_address(&self) -> Option<u16>
pub fn execution_address(&self) -> Option<u16>
Returns the address from when to start the program TODO really configure this address
sourcepub fn output(&mut self, v: u8) -> Result<bool, AssemblerError>
pub fn output(&mut self, v: u8) -> Result<bool, AssemblerError>
Output one byte either in the appropriate bank of the snapshot or in the termporary bank return true if it raised an override warning
pub fn allow_memory_override(&self) -> bool
sourcepub fn output_bytes(&mut self, bytes: &[u8]) -> Result<(), AssemblerError>
pub fn output_bytes(&mut self, bytes: &[u8]) -> Result<(), AssemblerError>
Write consecutives bytes
pub fn peek(&self, address: &PhysicalAddress) -> u8
pub fn poke(&mut self, byte: u8, address: &PhysicalAddress)
sourcepub fn size(&self) -> u16
pub fn size(&self) -> u16
Get the size of the generated binary. ATTENTION it can only work when geneating 0x10000 files
sourcepub fn eval(&self, expr: &Expr) -> Result<ExprResult, AssemblerError>
pub fn eval(&self, expr: &Expr) -> Result<ExprResult, AssemblerError>
Evaluate the expression according to the current state of the environment
pub fn sna(&self) -> &Snapshot
pub fn sna_version(&self) -> SnapshotVersion
pub fn save_sna<P: AsRef<Path>>(&self, fname: P) -> Result<(), Error>
sourceimpl Env
impl Env
sourcepub fn generate_symbols_output<W: Write>(&self, w: &mut W) -> Result<()>
pub fn generate_symbols_output<W: Write>(&self, w: &mut W) -> Result<()>
Write in w the list of symbols
sourcepub fn visit_listing<T: ListingElement + Visited + MayHaveSpan>(
&mut self,
listing: &[T]
) -> Result<(), AssemblerError>
pub fn visit_listing<T: ListingElement + Visited + MayHaveSpan>(
&mut self,
listing: &[T]
) -> Result<(), AssemblerError>
Visit all the tokens of the slice of tokens. Return true if an additional pass is requested
pub fn visit_macro_definition(
&mut self,
name: &str,
arguments: &[&str],
code: &str,
source: Option<&Z80Span>
) -> Result<(), AssemblerError>
pub fn visit_waitnops(&mut self, count: &Expr) -> Result<(), AssemblerError>
pub fn visit_struct_definition<T: ListingElement + ToSimpleToken, S: Borrow<str>>(
&mut self,
name: &str,
content: &[(S, T)],
source: Option<&Z80Span>
) -> Result<(), AssemblerError>
pub fn visit_buildsna(
&mut self,
version: Option<&SnapshotVersion>
) -> Result<(), AssemblerError>
pub fn visit_align(
&mut self,
boundary: &Expr,
fill: Option<&Expr>
) -> Result<(), AssemblerError>
sourcepub fn logical_to_physical_address(&self, address: u16) -> PhysicalAddress
pub fn logical_to_physical_address(&self, address: u16) -> PhysicalAddress
return the page and bank configuration for the given address at the current mmr configuration https://grimware.org/doku.php/documentations/devices/gatearray#mmr
sourcepub fn visit_undef(&mut self, label: &str) -> Result<(), AssemblerError>
pub fn visit_undef(&mut self, label: &str) -> Result<(), AssemblerError>
Remove the given variable from the table of symbols
pub fn visit_protect(
&mut self,
start: &Expr,
stop: &Expr
) -> Result<(), AssemblerError>
sourcepub fn visit_print(&mut self, info: &[FormattedExpr], span: Option<Z80Span>)
pub fn visit_print(&mut self, info: &[FormattedExpr], span: Option<Z80Span>)
Print the evaluation of the expression in the 2nd pass
pub fn visit_pause(&mut self, span: Option<Z80Span>)
pub fn visit_fail(
&self,
info: Option<&[FormattedExpr]>
) -> Result<(), AssemblerError>
pub fn visit_save(
&mut self,
filename: &str,
address: Option<&Expr>,
size: Option<&Expr>,
save_type: Option<&SaveType>,
dsk_filename: Option<&String>,
_side: Option<&Expr>
) -> Result<(), AssemblerError>
pub fn visit_charset(
&mut self,
format: &CharsetFormat
) -> Result<(), AssemblerError>
pub fn visit_snainit(&mut self, fname: &str) -> Result<(), AssemblerError>
pub fn visit_snaset(
&mut self,
flag: &SnapshotFlag,
value: &FlagValue
) -> Result<(), AssemblerError>
pub fn visit_incbin(&mut self, data: &[u8]) -> Result<(), AssemblerError>
sourcepub fn visit_crunched_section<'tokens, T: Visited + ListingElement + MayHaveSpan + Sync>(
&mut self,
kind: &CrunchType,
lst: &mut [ProcessedToken<'tokens, T>],
previous_bytes: &mut Option<Vec<u8>>,
previous_crunched_bytes: &mut Option<Vec<u8>>,
span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
<T as ListingElement>::Expr: ExprEvaluationExt,
ProcessedToken<'tokens, T>: FunctionBuilder,
<<T as ListingElement>::TestKind as TestKindElement>::Expr: ExprEvaluationExt,
pub fn visit_crunched_section<'tokens, T: Visited + ListingElement + MayHaveSpan + Sync>(
&mut self,
kind: &CrunchType,
lst: &mut [ProcessedToken<'tokens, T>],
previous_bytes: &mut Option<Vec<u8>>,
previous_crunched_bytes: &mut Option<Vec<u8>>,
span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
<T as ListingElement>::Expr: ExprEvaluationExt,
ProcessedToken<'tokens, T>: FunctionBuilder,
<<T as ListingElement>::TestKind as TestKindElement>::Expr: ExprEvaluationExt,
Handle a crunched section. bytes generated during previous pass or previous loop are provided TO NOT crunched them an additional time if they are similar
sourceimpl Env
impl Env
pub fn new(options: &AssemblingOptions, ctx: &ParserContext) -> Self
pub fn pass(&self) -> &AssemblingPass
sourceimpl Env
impl Env
pub fn visit_return(&mut self, e: &Expr) -> Result<(), AssemblerError>
pub fn user_defined_function(
&self,
name: &str
) -> Result<&Function, AssemblerError>
pub fn any_function<'res>(
&'res self,
name: &'res str
) -> Result<&'res Function, AssemblerError>
sourceimpl Env
impl Env
pub fn visit_while<E: ExprEvaluationExt, T: ListingElement<Expr = E> + Visited + MayHaveSpan>(
&mut self,
cond: &E,
code: &[T],
span: Option<Z80Span>
) -> Result<(), AssemblerError>
sourcepub fn visit_switch<'a, T, E>(
&mut self,
value: &E,
cases: impl Iterator<Item = (&'a E, &'a [T], bool)>,
default: Option<&'a [T]>,
_span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
E: ExprEvaluationExt,
E: 'a,
T: 'a + ListingElement<Expr = E> + Visited + MayHaveSpan,
pub fn visit_switch<'a, T, E>(
&mut self,
value: &E,
cases: impl Iterator<Item = (&'a E, &'a [T], bool)>,
default: Option<&'a [T]>,
_span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
E: ExprEvaluationExt,
E: 'a,
T: 'a + ListingElement<Expr = E> + Visited + MayHaveSpan,
Handle the switch directive
sourcepub fn visit_iterate<'token, E: ExprEvaluationExt, T: ListingElement<Expr = E> + Visited + MayHaveSpan + Sync>(
&mut self,
counter_name: &str,
values: Either<&Vec<E>, &E>,
code: &mut [ProcessedToken<'token, T>],
span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
<T as ListingElement>::Expr: ExprEvaluationExt,
<<T as ListingElement>::TestKind as TestKindElement>::Expr: ExprEvaluationExt,
ProcessedToken<'token, T>: FunctionBuilder,
pub fn visit_iterate<'token, E: ExprEvaluationExt, T: ListingElement<Expr = E> + Visited + MayHaveSpan + Sync>(
&mut self,
counter_name: &str,
values: Either<&Vec<E>, &E>,
code: &mut [ProcessedToken<'token, T>],
span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
<T as ListingElement>::Expr: ExprEvaluationExt,
<<T as ListingElement>::TestKind as TestKindElement>::Expr: ExprEvaluationExt,
ProcessedToken<'token, T>: FunctionBuilder,
Handle the iterate repetition directive Values is either a list of values or a Expression that represents a list
pub fn visit_rorg<'token, T, E>(
&mut self,
address: &E,
code: &mut [ProcessedToken<'token, T>],
span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
E: ExprEvaluationExt,
T: ListingElement<Expr = E> + Visited + MayHaveSpan + Sync,
<T as ListingElement>::Expr: ExprEvaluationExt,
<<T as ListingElement>::TestKind as TestKindElement>::Expr: ExprEvaluationExt,
ProcessedToken<'token, T>: FunctionBuilder,
sourcepub fn visit_for<'token, E: ExprEvaluationExt, T>(
&mut self,
label: &str,
start: &E,
stop: &E,
step: Option<&E>,
code: &mut [ProcessedToken<'token, T>],
span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
T: ListingElement<Expr = E> + Visited + MayHaveSpan + Sync,
<T as ListingElement>::Expr: ExprEvaluationExt,
<<T as ListingElement>::TestKind as TestKindElement>::Expr: ExprEvaluationExt,
ProcessedToken<'token, T>: FunctionBuilder,
pub fn visit_for<'token, E: ExprEvaluationExt, T>(
&mut self,
label: &str,
start: &E,
stop: &E,
step: Option<&E>,
code: &mut [ProcessedToken<'token, T>],
span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
T: ListingElement<Expr = E> + Visited + MayHaveSpan + Sync,
<T as ListingElement>::Expr: ExprEvaluationExt,
<<T as ListingElement>::TestKind as TestKindElement>::Expr: ExprEvaluationExt,
ProcessedToken<'token, T>: FunctionBuilder,
Handle the for directive
sourcepub fn visit_repeat_until<'token, E, T>(
&mut self,
cond: &E,
code: &mut [ProcessedToken<'token, T>],
span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
E: ExprEvaluationExt,
T: ListingElement<Expr = E> + Visited + MayHaveSpan + Sync,
<T as ListingElement>::Expr: ExprEvaluationExt,
<<T as ListingElement>::TestKind as TestKindElement>::Expr: ExprEvaluationExt,
ProcessedToken<'token, T>: FunctionBuilder,
pub fn visit_repeat_until<'token, E, T>(
&mut self,
cond: &E,
code: &mut [ProcessedToken<'token, T>],
span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
E: ExprEvaluationExt,
T: ListingElement<Expr = E> + Visited + MayHaveSpan + Sync,
<T as ListingElement>::Expr: ExprEvaluationExt,
<<T as ListingElement>::TestKind as TestKindElement>::Expr: ExprEvaluationExt,
ProcessedToken<'token, T>: FunctionBuilder,
Handle the standard repetition directive
sourcepub fn visit_repeat<'token, T, E>(
&mut self,
count: &E,
code: &mut [ProcessedToken<'token, T>],
counter: Option<&str>,
counter_start: Option<&E>,
span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
E: ExprEvaluationExt,
T: ListingElement<Expr = E> + Visited + MayHaveSpan + Sync,
<T as ListingElement>::Expr: ExprEvaluationExt,
<<T as ListingElement>::TestKind as TestKindElement>::Expr: ExprEvaluationExt,
ProcessedToken<'token, T>: FunctionBuilder,
pub fn visit_repeat<'token, T, E>(
&mut self,
count: &E,
code: &mut [ProcessedToken<'token, T>],
counter: Option<&str>,
counter_start: Option<&E>,
span: Option<&Z80Span>
) -> Result<(), AssemblerError> where
E: ExprEvaluationExt,
T: ListingElement<Expr = E> + Visited + MayHaveSpan + Sync,
<T as ListingElement>::Expr: ExprEvaluationExt,
<<T as ListingElement>::TestKind as TestKindElement>::Expr: ExprEvaluationExt,
ProcessedToken<'token, T>: FunctionBuilder,
Handle the statndard repetition directive
sourceimpl Env
impl Env
Macro related code
pub fn inc_macro_seed(&mut self)
pub fn macro_seed(&self) -> usize
sourceimpl Env
impl Env
pub fn visit_basic<S: Borrow<str> + Display>(
&mut self,
variables: Option<&Vec<S>>,
hidden_lines: Option<&Vec<u16>>,
code: &str
) -> Result<(), AssemblerError>
pub fn assemble_basic<S: Borrow<str> + Display>(
&mut self,
variables: Option<&Vec<S>>,
hidden_lines: Option<&Vec<u16>>,
code: &str
) -> Result<Vec<u8>, AssemblerError>
sourceimpl Env
impl Env
pub fn assemble_cp(&mut self, arg: &DataAccess) -> Result<Bytes, AssemblerError>
pub fn assemble_sub(
&mut self,
arg: &DataAccess
) -> Result<Bytes, AssemblerError>
pub fn assemble_sbc(
&mut self,
arg1: &DataAccess,
arg2: &DataAccess
) -> Result<Bytes, AssemblerError>
pub fn assemble_shift(
&mut self,
mne: Mnemonic,
target: &DataAccess,
hidden: Option<&DataAccess>
) -> Result<Bytes, AssemblerError>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Env
impl !Send for Env
impl Sync for Env
impl Unpin for Env
impl UnwindSafe for Env
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> FmtForward for T
impl<T> FmtForward for T
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Causes self to use its Binary implementation when Debug-formatted. Read more
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Causes self to use its Display implementation when
Debug-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self to use its LowerExp implementation when
Debug-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self to use its LowerHex implementation when
Debug-formatted. Read more
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Causes self to use its Octal implementation when Debug-formatted. Read more
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self to use its Pointer implementation when
Debug-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self to use its UpperExp implementation when
Debug-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self to use its UpperHex implementation when
Debug-formatted. Read more
fn fmt_list(self) -> FmtList<Self> where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self> where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
impl<T> Pipe for T where
T: ?Sized,
impl<T> Pipe for T where
T: ?Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
Pipes by value. This is generally the method you want to use. Read more
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
Borrows self and passes that borrow into the pipe function. Read more
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
Mutably borrows self and passes that borrow into the pipe function. Read more
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.borrow() into the pipe function. Read more
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
Mutably borrows self, then passes self.borrow_mut() into the pipe
function. Read more
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.as_ref() into the pipe function.
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
Mutably borrows self, then passes self.as_mut() into the pipe
function. Read more
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.deref() into the pipe function.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
sourcefn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
impl<T> Tap for T
impl<T> Tap for T
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Immutable access to the Borrow<B> of a value. Read more
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the BorrowMut<B> of a value. Read more
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Immutable access to the AsRef<R> view of a value. Read more
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Mutable access to the AsMut<R> view of a value. Read more
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Immutable access to the Deref::Target of a value. Read more
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Mutable access to the Deref::Target of a value. Read more
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls .tap() only in debug builds, and is erased in release builds.
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls .tap_mut() only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Calls .tap_borrow() only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Calls .tap_borrow_mut() only in debug builds, and is erased in release
builds. Read more
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Calls .tap_ref() only in debug builds, and is erased in release
builds. Read more
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Calls .tap_ref_mut() only in debug builds, and is erased in release
builds. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more