pub struct BytesLiteralValue { /* private fields */ }Expand description
The value representing a ExprBytesLiteral.
Implementations§
Source§impl BytesLiteralValue
impl BytesLiteralValue
Sourcepub fn single(value: BytesLiteral) -> BytesLiteralValue
pub fn single(value: BytesLiteral) -> BytesLiteralValue
Create a new bytestring literal with a single BytesLiteral part.
Sourcepub fn concatenated(values: Vec<BytesLiteral>) -> BytesLiteralValue
pub fn concatenated(values: Vec<BytesLiteral>) -> BytesLiteralValue
Creates a new bytestring literal with the given values that represents an implicitly concatenated bytestring.
§Panics
Panics if values has less than 2 elements.
Use BytesLiteralValue::single instead.
Sourcepub const fn is_implicit_concatenated(&self) -> bool
pub const fn is_implicit_concatenated(&self) -> bool
Returns true if the bytestring is implicitly concatenated.
Sourcepub fn as_slice(&self) -> &[BytesLiteral]
pub fn as_slice(&self) -> &[BytesLiteral]
Returns a slice of all the BytesLiteral parts contained in this value.
Sourcepub fn iter(&self) -> Iter<'_, BytesLiteral>
pub fn iter(&self) -> Iter<'_, BytesLiteral>
Returns an iterator over all the BytesLiteral parts contained in this value.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, BytesLiteral>
pub fn iter_mut(&mut self) -> IterMut<'_, BytesLiteral>
Returns an iterator over all the BytesLiteral parts contained in this value
that allows modification.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Return true if the node represents an empty bytestring.
Note that a BytesLiteralValue node will always have >=1 BytesLiteral parts
inside it. This method checks whether the value of the concatenated parts is equal
to the empty bytestring, not whether the bytestring has 0 parts inside it.
Trait Implementations§
Source§impl Clone for BytesLiteralValue
impl Clone for BytesLiteralValue
Source§fn clone(&self) -> BytesLiteralValue
fn clone(&self) -> BytesLiteralValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BytesLiteralValue
impl Debug for BytesLiteralValue
Source§impl GetSize for BytesLiteralValue
impl GetSize for BytesLiteralValue
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Source§fn get_heap_size_with_tracker<TRACKER>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)where
TRACKER: GetSizeTracker,
fn get_heap_size_with_tracker<TRACKER>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)where
TRACKER: GetSizeTracker,
tracker. Read moreSource§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Source§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
tracker. Read moreSource§impl<'a> IntoIterator for &'a BytesLiteralValue
impl<'a> IntoIterator for &'a BytesLiteralValue
Source§type Item = &'a BytesLiteral
type Item = &'a BytesLiteral
Source§type IntoIter = Iter<'a, BytesLiteral>
type IntoIter = Iter<'a, BytesLiteral>
Source§fn into_iter(self) -> <&'a BytesLiteralValue as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a BytesLiteralValue as IntoIterator>::IntoIter
Source§impl<'a> IntoIterator for &'a mut BytesLiteralValue
impl<'a> IntoIterator for &'a mut BytesLiteralValue
Source§type Item = &'a mut BytesLiteral
type Item = &'a mut BytesLiteral
Source§type IntoIter = IterMut<'a, BytesLiteral>
type IntoIter = IterMut<'a, BytesLiteral>
Source§fn into_iter(self) -> <&'a mut BytesLiteralValue as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a mut BytesLiteralValue as IntoIterator>::IntoIter
Source§impl PartialEq<[u8]> for BytesLiteralValue
impl PartialEq<[u8]> for BytesLiteralValue
Source§impl PartialEq for BytesLiteralValue
impl PartialEq for BytesLiteralValue
impl StructuralPartialEq for BytesLiteralValue
Auto Trait Implementations§
impl !Freeze for BytesLiteralValue
impl RefUnwindSafe for BytesLiteralValue
impl Send for BytesLiteralValue
impl Sync for BytesLiteralValue
impl Unpin for BytesLiteralValue
impl UnsafeUnpin for BytesLiteralValue
impl UnwindSafe for BytesLiteralValue
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,
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 more