Trait protobuf_native::DescriptorDatabase

source ·
pub trait DescriptorDatabase {
    // Required method
    fn find_file_by_name(
        self: Pin<&mut Self>,
        filename: &Path,
    ) -> Result<Pin<Box<FileDescriptorProto>>, OperationFailedError>;
}
Expand description

Abstract interface for a database of descriptors.

This is useful if you want to create a DescriptorPool which loads descriptors on-demand from some sort of large database. If the database is large, it may be inefficient to enumerate every .proto file inside it calling DescriptorPool::build_file for each one. Instead, a DescriptorPool can be created which wraps a DescriptorDatabase and only builds particular descriptors when they are needed.

Required Methods§

source

fn find_file_by_name( self: Pin<&mut Self>, filename: &Path, ) -> Result<Pin<Box<FileDescriptorProto>>, OperationFailedError>

Finds a file by file name.

Implementors§