Struct loopdev::AttachOptions [−][src]
pub struct AttachOptions<'d> { /* fields omitted */ }
Expand description
Used to set options when attaching a device. Created with LoopDevice::with().
Examples
Enable partition scanning on attach:
use loopdev::LoopDevice;
let mut ld = LoopDevice::open("/dev/loop6").unwrap();
ld.with()
.part_scan(true)
.attach("disk.img")
.unwrap();
A 1MiB slice of the file located at 1KiB into the file.
use loopdev::LoopDevice;
let mut ld = LoopDevice::open("/dev/loop7").unwrap();
ld.with()
.offset(1024*1024)
.size_limit(1024*1024*1024)
.attach("disk.img")
.unwrap();
Implementations
Offset in bytes from the start of the backing file the data will start at.
Maximum size of the data in bytes.
Force the kernel to scan the partition table on a newly created loop device. Note that the partition table parsing depends on sector sizes. The default is sector size is 512 bytes
Attach the loop device to a file with the set options.