pub struct ShebangTuple { /* private fields */ }Expand description
A tuple-like immutable container for shebang components that matches Python’s tuple behavior.
This type is designed to be a direct equivalent to Python’s tuple[str, ...] for
parse_shebang functions, providing immutable access to shebang components.
Implementations§
Source§impl ShebangTuple
impl ShebangTuple
Sourcepub const fn len(&self) -> usize
pub const fn len(&self) -> usize
Get the length of the tuple (equivalent to Python’s len(tuple))
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Check if the tuple is empty (equivalent to Python’s not tuple)
Sourcepub fn get(&self, index: usize) -> Option<&str>
pub fn get(&self, index: usize) -> Option<&str>
Get an element by index (equivalent to Python’s tuple[index])
Returns None if index is out of bounds
Sourcepub fn first(&self) -> Option<&str>
pub fn first(&self) -> Option<&str>
Get the first element (equivalent to Python’s tuple[0] when safe)
Trait Implementations§
Source§impl Clone for ShebangTuple
impl Clone for ShebangTuple
Source§fn clone(&self) -> ShebangTuple
fn clone(&self) -> ShebangTuple
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShebangTuple
impl Debug for ShebangTuple
Source§impl Default for ShebangTuple
impl Default for ShebangTuple
Source§impl Display for ShebangTuple
impl Display for ShebangTuple
Source§impl FromIterator<String> for ShebangTuple
impl FromIterator<String> for ShebangTuple
Source§impl Hash for ShebangTuple
impl Hash for ShebangTuple
Source§impl Index<usize> for ShebangTuple
impl Index<usize> for ShebangTuple
Source§impl<'a> IntoIterator for &'a ShebangTuple
impl<'a> IntoIterator for &'a ShebangTuple
Source§impl PartialEq for ShebangTuple
impl PartialEq for ShebangTuple
impl Eq for ShebangTuple
impl StructuralPartialEq for ShebangTuple
Auto Trait Implementations§
impl Freeze for ShebangTuple
impl RefUnwindSafe for ShebangTuple
impl Send for ShebangTuple
impl Sync for ShebangTuple
impl Unpin for ShebangTuple
impl UnwindSafe for ShebangTuple
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