Struct pica_record::primitives::TagRef
source · pub struct TagRef<'a>(/* private fields */);
Expand description
An immutable tag.
Implementations§
source§impl<'a> TagRef<'a>
impl<'a> TagRef<'a>
sourcepub fn new(tag: &'a str) -> Result<Self, ParsePicaError>
pub fn new(tag: &'a str) -> Result<Self, ParsePicaError>
sourcepub fn from_bytes<B: AsRef<[u8]> + ?Sized>(
tag: &'a B,
) -> Result<Self, ParsePicaError>
pub fn from_bytes<B: AsRef<[u8]> + ?Sized>( tag: &'a B, ) -> Result<Self, ParsePicaError>
Trait Implementations§
source§impl Index<usize> for TagRef<'_>
impl Index<usize> for TagRef<'_>
source§fn index(&self, index: usize) -> &Self::Output
fn index(&self, index: usize) -> &Self::Output
Access certain positions (indexed from zero) of a TagRef.
§Panics
This functions panics of the position is greater than three.
§Example
use pica_record::primitives::TagRef;
let tag = TagRef::new("003@")?;
assert_eq!(tag[0], b'0');
assert_eq!(tag[1], b'0');
assert_eq!(tag[2], b'3');
assert_eq!(tag[3], b'@');
impl<'a> Eq for TagRef<'a>
impl<'a> StructuralPartialEq for TagRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for TagRef<'a>
impl<'a> RefUnwindSafe for TagRef<'a>
impl<'a> Send for TagRef<'a>
impl<'a> Sync for TagRef<'a>
impl<'a> Unpin for TagRef<'a>
impl<'a> UnwindSafe for TagRef<'a>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)