pub struct SourceBundle { /* private fields */ }Expand description
Bounded, immutable-at-parse-time collection of uncompressed roff sources.
Paths use / separators and are exact relative logical identities. Empty
components, ., .., absolute paths, backslashes, and NUL bytes are
rejected. The native parser can only resolve .so requests to entries in
this collection; it never falls back to the host filesystem.
Implementations§
Source§impl SourceBundle
impl SourceBundle
Sourcepub const fn total_bytes(&self) -> usize
pub const fn total_bytes(&self) -> usize
Return the aggregate uncompressed byte size.
Sourcepub fn insert(
&mut self,
path: impl Into<String>,
source: impl Into<Vec<u8>>,
) -> Result<Option<Vec<u8>>, SourceBundleError>
pub fn insert( &mut self, path: impl Into<String>, source: impl Into<Vec<u8>>, ) -> Result<Option<Vec<u8>>, SourceBundleError>
Insert or replace one uncompressed source.
The previous bytes are returned when path already existed. Failed
insertions leave the bundle unchanged.
§Errors
Returns SourceBundleError when the logical path is unsafe or a
documented source-count or byte limit would be exceeded.
Trait Implementations§
Source§impl Clone for SourceBundle
impl Clone for SourceBundle
Source§fn clone(&self) -> SourceBundle
fn clone(&self) -> SourceBundle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SourceBundle
impl Debug for SourceBundle
Source§impl Default for SourceBundle
impl Default for SourceBundle
Source§fn default() -> SourceBundle
fn default() -> SourceBundle
Returns the “default value” for a type. Read more
impl Eq for SourceBundle
Source§impl PartialEq for SourceBundle
impl PartialEq for SourceBundle
impl StructuralPartialEq for SourceBundle
Auto Trait Implementations§
impl Freeze for SourceBundle
impl RefUnwindSafe for SourceBundle
impl Send for SourceBundle
impl Sync for SourceBundle
impl Unpin for SourceBundle
impl UnsafeUnpin for SourceBundle
impl UnwindSafe for SourceBundle
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