pub(crate) fn write_proto_to_file_raw<P, M>(key: &str, pb: M, parent_dir: P)
where
    P: AsRef<Path> + fmt::Debug,
    M: Message + std::clone::Clone,
{
    let mut buf = Vec::new();
    pb.encode(&mut buf).expect("Error serializing proto");
    let file_path = PathBuf::from(parent_dir.as_ref()).join(key);
    std::fs::write(file_path, buf).expect("Unable to write pb to file.");
}
/// Writes a protobuf registry entry to a file on disk, in the given path.
/// The file name is the key of the entry in the registry.
///
/// # Panics
///
/// Panics if the parent dir doesn't exist, or if the serialization fails.
Writes a protobuf registry entry to a file on disk, in the given path.
The file name is the key of the entry in the registry.
Writes a protobuf registry entry to a file on disk in the given path . The file name is the key of the entry in the registry .
pub(crate) fn write_proto_to_file_raw<P, M>(key: &str, pb: M, parent_dir: P)
where
    P: AsRef<Path> + fmt::Debug,
    M: Message + std::clone::Clone,
{
    let mut buf = Vec::new();
    pb.encode(&mut buf).expect("Error serializing proto");
    let file_path = PathBuf::from(parent_dir.as_ref()).join(key);
    std::fs::write(file_path, buf).expect("Unable to write pb to file.");
}
pub ( crate ) fn write_proto_to_file_raw < P , M > ( key : & str , pb : M , parent_dir : P ) where P : AsRef < Path > + fmt :: Debug , M : Message + std :: clone :: Clone , { let mut buf = Vec :: new ( ) ; pb . encode ( & mut buf ) . expect ( " " ) ; let file_path = PathBuf :: from ( parent_dir . as_ref ( ) ) . join ( key ) ; std :: fs :: write ( file_path , buf ) . expect ( " " ) ; }
Writes a protobuf registry entry to a file on disk, in the given path.
Writes a protobuf registry entry to a file on disk in the given path .
key
&str
pb
M
parent_dir
P
key
&str
pb
M
parent_dir
P
panics
Panics if the parent dir doesn't exist, or if the serialization fails.
Panics if the parent dir doesn ' t exist or if the serialization fails .