Token

Enum Token 

Source
pub enum Token {
Show 71 variants Abyte(Expr, Vec<Expr>), Align(Expr, Option<Expr>), AssemblerControl(StandardAssemblerControlCommand), Assert(Expr, Option<Vec<FormattedExpr>>), Assign { label: SmolStr, expr: Expr, op: Option<BinaryOperation>, }, Bank(Option<Expr>), Bankset(Expr), Basic(Option<Vec<SmolStr>>, Option<Vec<Expr>>, String), Break, Breakpoint { address: Option<Expr>, type: Option<RemuBreakPointType>, access: Option<RemuBreakPointAccessMode>, run: Option<RemuBreakPointRunMode>, mask: Option<Expr>, size: Option<Expr>, value: Option<Expr>, value_mask: Option<Expr>, condition: Option<Expr>, name: Option<Expr>, step: Option<Expr>, }, BuildCpr, BuildSna(Option<SnapshotVersion>), Charset(CharsetFormat), Comment(String), CrunchedBinary(CrunchType, SmolStr), CrunchedSection(CrunchType, BaseListing<Token>), Defb(Vec<Expr>), Defs(Vec<(Expr, Option<Expr>)>), Defw(Vec<Expr>), End, Equ { label: SmolStr, expr: Expr, }, Export(Vec<SmolStr>), Fail(Option<Vec<FormattedExpr>>), Field { label: SmolStr, expr: Expr, }, For { label: SmolStr, start: Expr, stop: Expr, step: Option<Expr>, listing: BaseListing<Token>, }, Function(SmolStr, Vec<SmolStr>, BaseListing<Token>), If(Vec<(TestKind, BaseListing<Token>)>, Option<BaseListing<Token>>), Incbin { fname: Expr, offset: Option<Expr>, length: Option<Expr>, extended_offset: Option<Expr>, off: bool, transformation: BinaryTransformation, }, Include(Expr, Option<SmolStr>, bool), Iterate(SmolStr, Either<Vec<Expr>, Expr>, BaseListing<Token>), Label(SmolStr), Let(SmolStr, Expr), Limit(Expr), List, Macro { name: SmolStr, params: Vec<SmolStr>, content: String, flavor: AssemblerFlavor, }, MacroCall(SmolStr, Vec<MacroParam>), Map(Expr), Module(SmolStr, BaseListing<Token>), MultiPop(Vec<DataAccess>), MultiPush(Vec<DataAccess>), Next { label: SmolStr, source: SmolStr, expr: Option<Expr>, }, NoExport(Vec<SmolStr>), NoList, OpCode(Mnemonic, Option<DataAccess>, Option<DataAccess>, Option<Register8>), Org { val1: Expr, val2: Option<Expr>, }, Pause, Print(Vec<FormattedExpr>), Protect(Expr, Expr), Range(String, Expr, Expr), Repeat(Expr, BaseListing<Token>, Option<SmolStr>, Option<Expr>), RepeatToken { token: Box<Token>, repeat: Expr, }, RepeatUntil(Expr, BaseListing<Token>), Return(Expr), Rorg(Expr, BaseListing<Token>), Run(Expr, Option<Expr>), Save { filename: Expr, address: Option<Expr>, size: Option<Expr>, save_type: Option<SaveType>, dsk_filename: Option<Expr>, side: Option<Expr>, }, Section(SmolStr), SetCPC(Expr), SetCrtc(Expr), SetN { label: SmolStr, source: SmolStr, expr: Option<Expr>, }, Skip(Expr), SnaInit(Expr), SnaSet(SnapshotFlag, FlagValue), StableTicker(StableTickerAction<SmolStr>), StartingIndex { start: Option<Expr>, step: Option<Expr>, }, Str(Vec<Expr>), Struct(SmolStr, Vec<(SmolStr, Token)>), Switch(Expr, Vec<(Expr, BaseListing<Token>, bool)>, Option<BaseListing<Token>>), Undef(SmolStr), WaitNops(Expr), While(Expr, BaseListing<Token>),
}
Expand description

The embeded Listing can be of several kind (with the token or with decorated version of the token)

Variants§

§

Abyte(Expr, Vec<Expr>)

§

Align(Expr, Option<Expr>)

§

AssemblerControl(StandardAssemblerControlCommand)

§

Assert(Expr, Option<Vec<FormattedExpr>>)

§

Assign

§

Bank(Option<Expr>)

Configure the bank - completely incompatible with rasm behavior The expression corresponds to the GATE ARRAY value to select the bank of interest

§

Bankset(Expr)

§

Basic(Option<Vec<SmolStr>>, Option<Vec<Expr>>, String)

Basic code which tokens will be included in the code (imported variables, lines to hide, code)

§

Break

§

Breakpoint

§

BuildCpr

§

BuildSna(Option<SnapshotVersion>)

§

Charset(CharsetFormat)

§

Comment(String)

§

CrunchedBinary(CrunchType, SmolStr)

§

CrunchedSection(CrunchType, BaseListing<Token>)

§

Defb(Vec<Expr>)

§

Defs(Vec<(Expr, Option<Expr>)>)

§

Defw(Vec<Expr>)

§

End

§

Equ

Fields

§label: SmolStr
§expr: Expr
§

Export(Vec<SmolStr>)

§

Fail(Option<Vec<FormattedExpr>>)

§

Field

Fields

§label: SmolStr
§expr: Expr
§

For

Fields

§label: SmolStr
§start: Expr
§stop: Expr
§step: Option<Expr>
§

Function(SmolStr, Vec<SmolStr>, BaseListing<Token>)

Function embeds a listing with a limited number of possible instructions and return a value

§

If(Vec<(TestKind, BaseListing<Token>)>, Option<BaseListing<Token>>)

Conditional expression. _0 contains all the expression and the appropriate code, _1 contains the else case

§

Incbin

Include of an asm file _0 contains the name of the file, _1 contains the content of the file. It is not loaded at the creation of the Token because there is not enough context to know where to load file

Fields

§fname: Expr
§offset: Option<Expr>
§length: Option<Expr>
§extended_offset: Option<Expr>
§off: bool
§transformation: BinaryTransformation
§

Include(Expr, Option<SmolStr>, bool)

§

Iterate(SmolStr, Either<Vec<Expr>, Expr>, BaseListing<Token>)

§

Label(SmolStr)

§

Let(SmolStr, Expr)

§

Limit(Expr)

§

List

§

Macro

Fields

§name: SmolStr
§params: Vec<SmolStr>
§content: String
§

MacroCall(SmolStr, Vec<MacroParam>)

§

Map(Expr)

§

Module(SmolStr, BaseListing<Token>)

§

MultiPop(Vec<DataAccess>)

§

MultiPush(Vec<DataAccess>)

§

Next

Fields

§label: SmolStr
§source: SmolStr
§expr: Option<Expr>
§

NoExport(Vec<SmolStr>)

§

NoList

§

OpCode(Mnemonic, Option<DataAccess>, Option<DataAccess>, Option<Register8>)

Very last argument concerns only few undocumented instructions that save their results in a register

§

Org

Fields

§val1: Expr
§val2: Option<Expr>
§

Pause

§

Print(Vec<FormattedExpr>)

§

Protect(Expr, Expr)

§

Range(String, Expr, Expr)

Define a named section in the current page

§

Repeat(Expr, BaseListing<Token>, Option<SmolStr>, Option<Expr>)

Duplicate the token stream

§

RepeatToken

Fields

§token: Box<Token>
§repeat: Expr
§

RepeatUntil(Expr, BaseListing<Token>)

§

Return(Expr)

Return value from a function

§

Rorg(Expr, BaseListing<Token>)

Set the value of $ to Expr

§

Run(Expr, Option<Expr>)

§

Save

Fields

§filename: Expr
§address: Option<Expr>
§size: Option<Expr>
§save_type: Option<SaveType>
§dsk_filename: Option<Expr>
§side: Option<Expr>
§

Section(SmolStr)

§

SetCPC(Expr)

§

SetCrtc(Expr)

§

SetN

Fields

§label: SmolStr
§source: SmolStr
§expr: Option<Expr>
§

Skip(Expr)

§

SnaInit(Expr)

This directive setup a value for a given flag of the snapshot

§

SnaSet(SnapshotFlag, FlagValue)

§

StableTicker(StableTickerAction<SmolStr>)

§

StartingIndex

Fields

§start: Option<Expr>
§step: Option<Expr>
§

Str(Vec<Expr>)

§

Struct(SmolStr, Vec<(SmolStr, Token)>)

§

Switch(Expr, Vec<(Expr, BaseListing<Token>, bool)>, Option<BaseListing<Token>>)

§

Undef(SmolStr)

§

WaitNops(Expr)

§

While(Expr, BaseListing<Token>)

Implementations§

Source§

impl Token

Source

pub fn new_opcode( mne: Mnemonic, arg1: Option<DataAccess>, arg2: Option<DataAccess>, ) -> Token

Source

pub fn fix_relative_jumps_after_disassembling(&mut self)

When diassembling code, the token with relative information are not appropriate

Source

pub fn is_opcode(&self) -> bool

Source

pub fn is_output_opcode(&self) -> bool

Source

pub fn is_input_opcode(&self) -> bool

Source

pub fn is_retlike_opcode(&self) -> bool

Source

pub fn is_autocopy_opcode(&self) -> bool

Check if it is an undocumented instruction that makes a copy of the data to save in an additional register

Source

pub fn label(&self) -> Option<&str>

Source

pub fn is_label(&self) -> bool

Source

pub fn macro_name(&self) -> Option<&str>

Source

pub fn macro_arguments(&self) -> Option<&[SmolStr]>

Source

pub fn macro_content(&self) -> Option<&str>

Source

pub fn org_expr(&self) -> Option<&Expr>

👎Deprecated since 0.1.1: please use expr instead as other token need it

Rename the @labels in macros XXX no more needed - to remove later

Source

pub fn expr(&self) -> Option<&Expr>

Source

pub fn has_at_least_one_listing(&self) -> bool

Return true for directives that can emebed some listing information

Trait Implementations§

Source§

impl Clone for Token

Source§

fn clone(&self) -> Token

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Token

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for Token

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<&Token> for DbLikeKind

Source§

fn from(token: &Token) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Token

Source§

fn from(byte: u8) -> Token

Converts to this type from the input type.
Source§

impl Hash for Token

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl ListingElement for Token

Source§

type AssemblerControlCommand = StandardAssemblerControlCommand

Source§

type DataAccess = DataAccess

Source§

type Expr = Expr

Source§

type MacroParam = MacroParam

Source§

type TestKind = TestKind

Source§

fn is_run(&self) -> bool

Source§

fn is_repeat_token(&self) -> bool

Source§

fn repeat_token(&self) -> &Token

Source§

fn is_save(&self) -> bool

Source§

fn is_breakpoint(&self) -> bool

Source§

fn run_expr(&self) -> &<Token as ListingElement>::Expr

Source§

fn equ_symbol(&self) -> &str

Source§

fn rorg_expr(&self) -> &<Token as ListingElement>::Expr

Source§

fn equ_value(&self) -> &<Token as ListingElement>::Expr

Source§

fn assign_symbol(&self) -> &str

Source§

fn module_name(&self) -> &str

Source§

fn mnemonic(&self) -> Option<&Mnemonic>

Source§

fn mnemonic_arg2(&self) -> Option<&<Token as ListingElement>::DataAccess>

Source§

fn mnemonic_arg1_mut( &mut self, ) -> Option<&mut <Token as ListingElement>::DataAccess>

Source§

fn iterate_counter_name(&self) -> &str

Source§

fn iterate_values( &self, ) -> Either<&Vec<<Token as ListingElement>::Expr>, &<Token as ListingElement>::Expr>

Source§

fn mnemonic_arg2_mut( &mut self, ) -> Option<&mut <Token as ListingElement>::DataAccess>

Source§

fn while_expr(&self) -> &<Token as ListingElement>::Expr

Source§

fn assign_value(&self) -> &<Token as ListingElement>::Expr

Source§

fn is_switch(&self) -> bool

Source§

fn is_if(&self) -> bool

Source§

fn is_repeat(&self) -> bool

Source§

fn is_for(&self) -> bool

Source§

fn is_directive(&self) -> bool

Source§

fn is_module(&self) -> bool

Source§

fn is_while(&self) -> bool

Source§

fn is_iterate(&self) -> bool

Source§

fn is_repeat_until(&self) -> bool

Source§

fn is_include(&self) -> bool

Source§

fn is_incbin(&self) -> bool

Source§

fn is_call_macro_or_build_struct(&self) -> bool

Source§

fn is_function_definition(&self) -> bool

Source§

fn is_crunched_section(&self) -> bool

Source§

fn is_rorg(&self) -> bool

Source§

fn is_db(&self) -> bool

Source§

fn is_dw(&self) -> bool

Source§

fn is_str(&self) -> bool

Source§

fn is_set(&self) -> bool

Source§

fn is_buildcpr(&self) -> bool

Source§

fn is_assembler_control(&self) -> bool

Source§

fn is_assert(&self) -> bool

Source§

fn is_assign(&self) -> bool

Source§

fn is_comment(&self) -> bool

Source§

fn is_equ(&self) -> bool

Source§

fn is_label(&self) -> bool

Source§

fn is_org(&self) -> bool

Source§

fn org_first(&self) -> &<Token as ListingElement>::Expr

Source§

fn org_second(&self) -> Option<&<Token as ListingElement>::Expr>

Source§

fn is_print(&self) -> bool

Source§

fn for_label(&self) -> &str

Source§

fn for_start(&self) -> &<Token as ListingElement>::Expr

Source§

fn for_stop(&self) -> &<Token as ListingElement>::Expr

Source§

fn for_step(&self) -> Option<&<Token as ListingElement>::Expr>

Source§

fn repeat_until_condition(&self) -> &<Token as ListingElement>::Expr

Source§

fn repeat_count(&self) -> &<Token as ListingElement>::Expr

Source§

fn repeat_counter_name(&self) -> Option<&str>

Source§

fn repeat_counter_start(&self) -> Option<&<Token as ListingElement>::Expr>

Source§

fn is_macro_definition(&self) -> bool

Source§

fn macro_definition_name(&self) -> &str

Source§

fn macro_definition_arguments(&self) -> SmallVec<[&str; 4]>

Source§

fn macro_definition_code(&self) -> &str

Source§

fn macro_call_name(&self) -> &str

Source§

fn macro_call_arguments(&self) -> &[<Token as ListingElement>::MacroParam]

Source§

fn if_nb_tests(&self) -> usize

Source§

fn incbin_fname(&self) -> &<Token as ListingElement>::Expr

Source§

fn incbin_offset(&self) -> Option<&<Token as ListingElement>::Expr>

Source§

fn incbin_length(&self) -> Option<&<Token as ListingElement>::Expr>

Source§

fn incbin_transformation(&self) -> &BinaryTransformation

Source§

fn include_fname(&self) -> &<Token as ListingElement>::Expr

Source§

fn include_namespace(&self) -> Option<&str>

Source§

fn include_once(&self) -> bool

Source§

fn function_definition_name(&self) -> &str

Source§

fn function_definition_params(&self) -> SmallVec<[&str; 4]>

Source§

fn crunched_section_kind(&self) -> &CrunchType

Source§

fn switch_expr(&self) -> &<Token as ListingElement>::Expr

Source§

fn data_exprs(&self) -> &[<Token as ListingElement>::Expr]

Source§

fn to_token(&self) -> Cow<'_, Token>

Source§

fn is_warning(&self) -> bool

Source§

fn warning_token(&self) -> &Token

Source§

fn warning_message(&self) -> &str

Source§

fn module_listing(&self) -> &[Token]

Source§

fn while_listing(&self) -> &[Token]

Source§

fn mnemonic_arg1(&self) -> Option<&<Token as ListingElement>::DataAccess>

Source§

fn iterate_listing(&self) -> &[Token]

Source§

fn for_listing(&self) -> &[Token]

Source§

fn repeat_until_listing(&self) -> &[Token]

Source§

fn repeat_listing(&self) -> &[Token]

Source§

fn if_test( &self, idx: usize, ) -> (&<Token as ListingElement>::TestKind, &[Token])

Source§

fn if_else(&self) -> Option<&[Token]>

Source§

fn function_definition_inner(&self) -> &[Token]

Source§

fn crunched_section_listing(&self) -> &[Token]

Source§

fn rorg_listing(&self) -> &[Token]

Source§

fn is_confined(&self) -> bool

Source§

fn confined_listing(&self) -> &[Token]

Source§

fn switch_cases( &self, ) -> Box<dyn Iterator<Item = (&<Token as ListingElement>::Expr, &[Token], bool)> + '_>

Source§

fn switch_default(&self) -> Option<&[Token]>

Source§

fn repeat_counter_step(&self) -> Option<&<Token as ListingElement>::Expr>

Source§

fn assembler_control_command( &self, ) -> &<Token as ListingElement>::AssemblerControlCommand

Source§

fn assembler_control_get_max_passes( &self, ) -> Option<&<Token as ListingElement>::Expr>

Source§

fn assembler_control_get_listing(&self) -> &[Token]

Source§

fn macro_flavor(&self) -> AssemblerFlavor

Source§

fn defer_listing_output(&self) -> bool

Source§

fn is_opcode(&self) -> bool

Source§

fn include_is_standard_include(&self) -> bool

Source§

fn starts_with_label(&self) -> bool

Source§

impl MayHaveSpan for Token

Source§

impl ParseToken for Token

Source§

impl ParsingStateVerified for Token

Source§

fn is_accepted(&self, state: &ParsingState) -> bool

Source§

impl PartialEq for Token

Source§

fn eq(&self, other: &Token) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ReturnExpr for Token

Source§

type Expr = Expr

Source§

fn return_expr(&self) -> Option<&Self::Expr>

Source§

impl ToSimpleToken for Token

Source§

fn as_simple_token(&self) -> Cow<'_, Token>

Convert the token in its simplest form
Source§

impl TokenExt for Token

Source§

fn unroll(&self, env: &mut Env) -> Option<Result<Vec<&Self>, AssemblerError>>

Unroll the tokens when in a repetition loop TODO return an iterator in order to not produce the vector each time

Source§

fn disassemble_data(&self) -> Result<Listing, String>

Generate the listing of opcodes for directives that contain data Defb/defw/Defs in order to have mnemonics. Fails when some values are not opcodes

Source§

fn estimated_duration(&self) -> Result<usize, AssemblerError>

Returns an estimation of the duration. This estimation may be wrong for instruction having several states.

Source§

fn fallback_number_of_bytes(&self) -> Result<usize, String>

returns the number of bytes without assembling it
Source§

fn to_bytes_with_options( &self, option: EnvOptions, ) -> Result<Vec<u8>, AssemblerError>

Source§

fn number_of_bytes(&self) -> Result<usize, String>

Returns the number of bytes of the instructions by assembling it
Source§

fn number_of_bytes_with_context( &self, table: &mut SymbolsTableCaseDependent, ) -> Result<usize, String>

Return the number of bytes of the token given the provided context
Source§

fn to_bytes(&self) -> Result<Vec<u8>, AssemblerError>

Dummy version that assemble without taking into account the context TODO find a way to not build a symbol table each time
Source§

fn to_bytes_with_context( &self, table: &mut SymbolsTableCaseDependent, ) -> Result<Vec<u8>, AssemblerError>

Assemble the symbol taking into account some context, but never modify this context
Source§

fn is_valid(&self) -> bool

Check if the token is valid. We consider a token vlaid if it is possible to assemble it
Source§

impl Visited for Token

Source§

fn visited(&self, env: &mut Env) -> Result<(), AssemblerError>

Make all the necessary for the given token
Source§

impl Eq for Token

Source§

impl StructuralPartialEq for Token

Auto Trait Implementations§

§

impl Freeze for Token

§

impl RefUnwindSafe for Token

§

impl Send for Token

§

impl Sync for Token

§

impl Unpin for Token

§

impl UnwindSafe for Token

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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.
Source§

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.
Source§

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.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

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.
Source§

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.
Source§

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.
Source§

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.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

fn to_compact_string(&self) -> CompactString

Converts the given value to a CompactString. Read more
Source§

impl<T> ToOrgams for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.