Struct rust_bert::resources::LocalResource
source · pub struct LocalResource {
pub local_path: PathBuf,
}
Expand description
Fields§
§local_path: PathBuf
Local path for the resource
Trait Implementations§
source§impl Clone for LocalResource
impl Clone for LocalResource
source§fn clone(&self) -> LocalResource
fn clone(&self) -> LocalResource
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LocalResource
impl Debug for LocalResource
source§impl From<PathBuf> for LocalResource
impl From<PathBuf> for LocalResource
source§impl PartialEq for LocalResource
impl PartialEq for LocalResource
source§fn eq(&self, other: &LocalResource) -> bool
fn eq(&self, other: &LocalResource) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ResourceProvider for LocalResource
impl ResourceProvider for LocalResource
source§fn get_local_path(&self) -> Result<PathBuf, RustBertError>
fn get_local_path(&self) -> Result<PathBuf, RustBertError>
Gets the path for a local resource.
Returns
PathBuf
pointing 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();
source§fn get_resource(&self) -> Result<Resource<'_>, RustBertError>
fn get_resource(&self) -> Result<Resource<'_>, RustBertError>
Gets a wrapper around the path for a local resource.
Returns
Resource
wrapping aPathBuf
pointing 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_resource();
impl Eq for LocalResource
impl StructuralEq for LocalResource
impl StructuralPartialEq for LocalResource
Auto Trait Implementations§
impl RefUnwindSafe for LocalResource
impl Send for LocalResource
impl Sync for LocalResource
impl Unpin for LocalResource
impl UnwindSafe for LocalResource
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.