[][src]Function cryptsetup_rs::api::format

pub fn format<P: AsRef<Path>>(path: P) -> Result<CryptDeviceFormatBuilder>

Builder to format a crypt device at the specified path

Examples

use cryptsetup_rs::*;
use uuid::Uuid;

let uuid = Uuid::new_v4();
let device = format("/dev/loop0")?
    .rng_type(crypt_rng_type::CRYPT_RNG_URANDOM)
    .iteration_time(5000)
    .luks1("aes", "xts-plain", "sha256", 256, Some(&uuid))?;