pub enum ModelAsset {
Path(PathBuf),
Bytes {
name: String,
data: Arc<[u8]>,
},
}Expand description
A single model asset that can come from disk or in-memory bytes.
Variants§
Implementations§
Source§impl ModelAsset
impl ModelAsset
pub fn from_path(path: impl Into<PathBuf>) -> Self
pub fn from_bytes(name: impl Into<String>, bytes: impl Into<Vec<u8>>) -> Self
pub fn as_path(&self) -> Option<&Path>
pub fn file_name(&self) -> Option<&str>
pub fn extension(&self) -> Option<&str>
pub fn display_name(&self) -> String
pub fn read_bytes(&self) -> Result<Arc<[u8]>, TtsError>
Trait Implementations§
Source§impl Clone for ModelAsset
impl Clone for ModelAsset
Source§fn clone(&self) -> ModelAsset
fn clone(&self) -> ModelAsset
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for ModelAsset
impl RefUnwindSafe for ModelAsset
impl Send for ModelAsset
impl Sync for ModelAsset
impl Unpin for ModelAsset
impl UnsafeUnpin for ModelAsset
impl UnwindSafe for ModelAsset
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more