pub struct InventoryFile;Expand description
Inventory file handler - mirrors Sphinx’s InventoryFile class
Implementations§
Source§impl InventoryFile
impl InventoryFile
Sourcepub fn loads(content: &[u8], uri: &str) -> Result<Inventory>
pub fn loads(content: &[u8], uri: &str) -> Result<Inventory>
Load inventory from bytes (mirrors Sphinx’s InventoryFile.loads).
Operates on raw bytes throughout the header framing and the
version-2 zlib tail — the compressed payload is never decoded as
text, never line-split, until after zlib::decompress succeeds.
Sourcepub async fn load<P: AsRef<Path>>(filename: P, uri: &str) -> Result<Inventory>
pub async fn load<P: AsRef<Path>>(filename: P, uri: &str) -> Result<Inventory>
Load inventory from file
Sourcepub async fn dump<P: AsRef<Path>>(
path: P,
project: &str,
version: &str,
domains: &[(&str, Vec<InvObject>)],
get_target_uri: impl Fn(&str) -> String,
) -> Result<()>
pub async fn dump<P: AsRef<Path>>( path: P, project: &str, version: &str, domains: &[(&str, Vec<InvObject>)], get_target_uri: impl Fn(&str) -> String, ) -> Result<()>
Write inventory to path in Sphinx’s version-2 format
(mirrors InventoryFile.dump, inventory.py:174-207).
Decoupled from BuildEnvironment/Builder: callers supply the
already-collected per-domain object lists and a get_target_uri
closure (Builder.get_target_uri(docname) in Sphinx) instead of
live env/builder references.
domains need not be pre-sorted — this sorts domains alphabetically
by name and, within each domain, sorts its objects by
(name, dispname, objtype, docname, anchor, priority), mirroring
env.domains.sorted() + sorted(domain.get_objects())
(inventory.py:194-196).
Auto Trait Implementations§
impl Freeze for InventoryFile
impl RefUnwindSafe for InventoryFile
impl Send for InventoryFile
impl Sync for InventoryFile
impl Unpin for InventoryFile
impl UnsafeUnpin for InventoryFile
impl UnwindSafe for InventoryFile
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more