pub struct Directory<'a, W: Write> {
node: Node<'a, W>,
prev_name: Option<Vec<u8>>,
}
Expand description
Content of a NAR node that represents a directory.
Fields§
§node: Node<'a, W>
§prev_name: Option<Vec<u8>>
Implementations§
source§impl<'a, W: Write> Directory<'a, W>
impl<'a, W: Write> Directory<'a, W>
fn new(node: Node<'a, W>) -> Self
sourcepub fn entry(&mut self, name: &[u8]) -> Result<Node<'_, W>>
pub fn entry(&mut self, name: &[u8]) -> Result<Node<'_, W>>
Add an entry to the directory.
The entry is simply another Node
, which can then be filled like the
root of a NAR (including, of course, by nesting directories).
It is the caller’s responsibility to ensure that directory entries are written in order of ascending name. If this is not ensured, this method may panic or silently produce invalid archives.
Auto Trait Implementations§
impl<'a, W> Freeze for Directory<'a, W>
impl<'a, W> RefUnwindSafe for Directory<'a, W>where
W: RefUnwindSafe,
impl<'a, W> Send for Directory<'a, W>where
W: Send,
impl<'a, W> Sync for Directory<'a, W>where
W: Sync,
impl<'a, W> Unpin for Directory<'a, W>
impl<'a, W> !UnwindSafe for Directory<'a, W>
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