Struct x_lint::content::ContentContext
source · pub struct ContentContext<'l> { /* private fields */ }
Implementations§
source§impl<'l> ContentContext<'l>
impl<'l> ContentContext<'l>
sourcepub const BINARY_FILE_CUTOFF: usize = 8_000usize
pub const BINARY_FILE_CUTOFF: usize = 8_000usize
The number of bytes that will be searched for null bytes in a file to figure out if it is binary.
The value is the same as Git’s.
sourcepub fn file_ctx(&self) -> &FilePathContext<'l>
pub fn file_ctx(&self) -> &FilePathContext<'l>
Returns the file context.
sourcepub fn content(&self) -> Option<&str>
pub fn content(&self) -> Option<&str>
Returns the content, or None
if this is a non-UTF-8 file.
sourcepub fn content_bytes(&self) -> &[u8] ⓘ
pub fn content_bytes(&self) -> &[u8] ⓘ
Returns the raw bytes for the content.
Trait Implementations§
Auto Trait Implementations§
impl<'l> RefUnwindSafe for ContentContext<'l>
impl<'l> Send for ContentContext<'l>
impl<'l> Sync for ContentContext<'l>
impl<'l> Unpin for ContentContext<'l>
impl<'l> UnwindSafe for ContentContext<'l>
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SafeBorrow<T> for Twhere
T: ?Sized,
impl<T> SafeBorrow<T> for Twhere T: ?Sized,
§fn borrow_replacement(ptr: &T) -> &T
fn borrow_replacement(ptr: &T) -> &T
Given
ptr
, which was obtained from a prior call to Self::borrow()
,
return a value with the same nominal lifetime which is guaranteed to
survive mutations to Self
. Read more