pub struct CircularCodesizePlaceholderData {
pub macro_name: String,
pub push_opcode: PushOpcode,
pub resolved_value: Option<usize>,
pub measured_range: Option<(usize, usize)>,
pub size_hint: Option<usize>,
}Expand description
Data for a circular codesize placeholder
Fields§
§macro_name: StringThe macro name that contains this circular reference
push_opcode: PushOpcodeThe push opcode to use (starts as PUSH1 and only grows until the size fits)
resolved_value: Option<usize>The resolved macro size (None if not yet resolved)
measured_range: Option<(usize, usize)>Code range [start, end) of the macro invocation whose size is pushed, in the same offsets
as the surrounding segments. Set once that invocation is fully generated; without it the
size of the whole code is pushed.
size_hint: Option<usize>Size of the named macro from the previous compile pass, used when the code being generated does not contain the named macro, so its size cannot be measured here
Implementations§
Source§impl CircularCodesizePlaceholderData
impl CircularCodesizePlaceholderData
Sourcepub fn new(macro_name: String, size_hint: Option<usize>) -> Self
pub fn new(macro_name: String, size_hint: Option<usize>) -> Self
Create a new unresolved circular codesize placeholder Starts with PUSH1 optimistically, may grow during resolution
Sourcepub fn size(
&self,
measured: impl FnOnce((usize, usize)) -> usize,
total_length: usize,
) -> usize
pub fn size( &self, measured: impl FnOnce((usize, usize)) -> usize, total_length: usize, ) -> usize
The size this placeholder pushes: the measured invocation, else the size hint, else the whole code it is part of
Trait Implementations§
impl Eq for CircularCodesizePlaceholderData
Source§impl Ord for CircularCodesizePlaceholderData
impl Ord for CircularCodesizePlaceholderData
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for CircularCodesizePlaceholderData
impl PartialOrd for CircularCodesizePlaceholderData
impl StructuralPartialEq for CircularCodesizePlaceholderData
Auto Trait Implementations§
impl Freeze for CircularCodesizePlaceholderData
impl RefUnwindSafe for CircularCodesizePlaceholderData
impl Send for CircularCodesizePlaceholderData
impl Sync for CircularCodesizePlaceholderData
impl Unpin for CircularCodesizePlaceholderData
impl UnsafeUnpin for CircularCodesizePlaceholderData
impl UnwindSafe for CircularCodesizePlaceholderData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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<S, T> Upcast<T> for S
impl<S, T> Upcast<T> for S
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 88 bytes