Trait rust_bert::resources::ResourceProvider
source · [−]pub trait ResourceProvider {
fn get_local_path(&self) -> Result<PathBuf, RustBertError>;
}Expand description
Required Methods
fn get_local_path(&self) -> Result<PathBuf, RustBertError>
fn get_local_path(&self) -> Result<PathBuf, RustBertError>
Provides the local path for a resource.
Returns
PathBufpointing to the resource file
Example
use rust_bert::resources::{LocalResource, ResourceProvider};
use std::path::PathBuf;
let config_resource = LocalResource {
local_path: PathBuf::from("path/to/config.json"),
};
let config_path = config_resource.get_local_path();