Skip to main content

get_binary_path

Function get_binary_path 

Source
pub fn get_binary_path<P: AsRef<Path>>(
    source_path: P,
    config: &BinaryConfig,
) -> PathBuf
Expand description

Get the output path for a .sr file

§Arguments

  • source_path - Path to the source .dx file
  • config - Binary output configuration

§Returns

The full path where the .sr file should be written

§Example

use serializer::binary_output::{BinaryConfig, get_binary_path};
use std::path::PathBuf;

let config = BinaryConfig::with_root("/project");
let output = get_binary_path("/project/src/config.dx", &config);

// Output path contains the hash directory and .dx extension
assert!(output.to_string_lossy().contains(".dx/serializer"));
assert!(output.to_string_lossy().ends_with(".dx"));