Skip to content

Allow passing descriptor_set as bytes instead of a file path #407

Description

@anuraaga

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions