Currently, buffa-build allows passing a descriptor_set to use instead of proto files
|
pub fn descriptor_set(mut self, path: impl Into<PathBuf>) -> Self { |
This is then just read into bytes
|
DescriptorSource::Precompiled(path) => std::fs::read(path).map_err(|e| { |
It would be great if bytes could be passed directly for when the build script can prepare them, for example using protox. Perhaps changing Precompiled to hold a Vec<u8> and have the parameter accept either a sealed trait that is implemented for both Path and &[u8], or if breaking is ok, just accept the slice only since reading a path (as buffa-build currently does) wouldn't be that hard for a user.
Currently, buffa-build allows passing a descriptor_set to use instead of proto files
buffa/buffa-build/src/lib.rs
Line 1640 in ccc9add
This is then just read into bytes
buffa/buffa-build/src/lib.rs
Line 1772 in ccc9add
It would be great if bytes could be passed directly for when the build script can prepare them, for example using protox. Perhaps changing
Precompiledto hold aVec<u8>and have the parameter accept either a sealed trait that is implemented for bothPathand&[u8], or if breaking is ok, just accept the slice only since reading a path (as buffa-build currently does) wouldn't be that hard for a user.