Enum rust_bert::resources::Resource [−][src]
pub enum Resource {
Local(LocalResource),
Remote(RemoteResource),
}Expand description
Resource Enum pointing to model, configuration or vocabulary resources
Can be of type:
- LocalResource
- RemoteResource
Variants
Local(LocalResource)
Tuple Fields
Remote(RemoteResource)
Tuple Fields
Implementations
Gets the local path for a given resource.
If the resource is a remote resource, it is downloaded and cached. Then the path to the local cache is returned.
Returns
PathBufpointing to the resource file
Example
use rust_bert::resources::{LocalResource, Resource};
use std::path::PathBuf;
let config_resource = Resource::Local(LocalResource {
local_path: PathBuf::from("path/to/config.json"),
});
let config_path = config_resource.get_local_path();Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Resource
impl UnwindSafe for Resource
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self
