pub struct File<D> {
pub name: String,
pub compressed: Option<bool>,
pub data: D,
}Fields§
§name: String§compressed: Option<bool>§data: DImplementations§
Source§impl<D> File<D>
impl<D> File<D>
Sourcepub fn new<N: Into<String>>(name: N, data: D) -> Self
pub fn new<N: Into<String>>(name: N, data: D) -> Self
Examples found in repository?
examples/create-options.rs (line 12)
9fn main() -> Result<()> {
10 let dirs = [
11 Dir::new("a", [
12 File::new("b", PathBuf::from("some-file"))
13 ])
14 ];
15
16 let writer = WriterV105::new(
17 [ArchiveFlagV105::CompressedArchive, ArchiveFlagV105::EmbedFileNames],
18 [FileFlag::Miscellaneous],
19 );
20 let out = fs::File::create("some.bsa")?;
21 writer.write_bsa(dirs, out)
22}Trait Implementations§
impl<D: Eq> Eq for File<D>
impl<D> StructuralPartialEq for File<D>
Auto Trait Implementations§
impl<D> Freeze for File<D>where
D: Freeze,
impl<D> RefUnwindSafe for File<D>where
D: RefUnwindSafe,
impl<D> Send for File<D>where
D: Send,
impl<D> Sync for File<D>where
D: Sync,
impl<D> Unpin for File<D>where
D: Unpin,
impl<D> UnwindSafe for File<D>where
D: UnwindSafe,
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