pub enum LightSourceView<'a> {
Text(SourceView<'a>),
Bytes {
bytes: &'a [u8],
encoding: SourceEncoding,
},
}Variants§
Implementations§
Source§impl<'a> LightSourceView<'a>
impl<'a> LightSourceView<'a>
pub fn raw_slice(self, range: TextRange) -> &'a [u8] ⓘ
pub fn try_ascii_slice(self, range: TextRange) -> Option<&'a str>
pub fn decode_slice_lossy_for_preview(self, range: TextRange) -> Cow<'a, str>
pub fn decode_slice(self, range: TextRange) -> DecodedLightSlice<'a>
pub fn len(self) -> usize
pub fn is_empty(self) -> bool
Trait Implementations§
Source§impl<'a> Clone for LightSourceView<'a>
impl<'a> Clone for LightSourceView<'a>
Source§fn clone(&self) -> LightSourceView<'a>
fn clone(&self) -> LightSourceView<'a>
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 moreimpl<'a> Copy for LightSourceView<'a>
Auto Trait Implementations§
impl<'a> Freeze for LightSourceView<'a>
impl<'a> RefUnwindSafe for LightSourceView<'a>
impl<'a> Send for LightSourceView<'a>
impl<'a> Sync for LightSourceView<'a>
impl<'a> Unpin for LightSourceView<'a>
impl<'a> UnsafeUnpin for LightSourceView<'a>
impl<'a> UnwindSafe for LightSourceView<'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