pub struct SyntaxBound {
pub per_node: usize,
pub byte_num: usize,
pub byte_den: usize,
}Expand description
The per-node and per-byte terms of a syntax-tree storage bound.
The bound is nodes * per_node + ceil(text_bytes * byte_num / byte_den), where nodes is the
exact native token-tree node count of the lexed stream and text_bytes is
the source length. It is computed before the parser runs, so a caller can
admit it first. The production terms are measured, not proven; see
SYNTAX_BYTES_PER_NODE.
Fields§
§per_node: usizeBytes of peak parse storage per native token-tree node.
byte_num: usizeNumerator of the bytes of peak parse storage per source byte.
byte_den: usizeDenominator of the bytes of peak parse storage per source byte.
Implementations§
Trait Implementations§
Source§impl Clone for SyntaxBound
impl Clone for SyntaxBound
impl Copy for SyntaxBound
Source§impl Debug for SyntaxBound
impl Debug for SyntaxBound
impl Eq for SyntaxBound
Source§impl PartialEq for SyntaxBound
impl PartialEq for SyntaxBound
impl StructuralPartialEq for SyntaxBound
Auto Trait Implementations§
impl Forget for SyntaxBound
impl Freeze for SyntaxBound
impl Move for SyntaxBound
impl RefUnwindSafe for SyntaxBound
impl Send for SyntaxBound
impl Sync for SyntaxBound
impl Unpin for SyntaxBound
impl UnsafeUnpin for SyntaxBound
impl UnwindSafe for SyntaxBound
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Whether this borrowed key equals the stored key.
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> EvidenceLease 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