pub struct ProfileStore { /* private fields */ }Available on non-
target_family=wasm only.Expand description
The directory of enrolled voices.
Implementations§
Source§impl ProfileStore
impl ProfileStore
pub fn open(directory: impl Into<PathBuf>) -> Self
Sourcepub fn read_all(&self) -> Result<StoredProfiles, ProfileError>
pub fn read_all(&self) -> Result<StoredProfiles, ProfileError>
Every profile in the directory. One unreadable file does not hide the
others; it comes back in StoredProfiles::unreadable. A directory
that does not exist means nobody has enrolled, which is ordinary.
Sourcepub fn read_for(
&self,
engine: &str,
dimension: usize,
) -> Result<StoredProfiles, ProfileError>
pub fn read_for( &self, engine: &str, dimension: usize, ) -> Result<StoredProfiles, ProfileError>
The profiles engine measured, at the width it produces. Everything
else was made by a different model and cannot be compared.
Sourcepub fn save(
&self,
profile: &Profile,
replace: Replace,
) -> Result<(), ProfileError>
pub fn save( &self, profile: &Profile, replace: Replace, ) -> Result<(), ProfileError>
Stores a profile. Replace::Never refuses when a profile is already
there, judged by the filesystem rather than by comparing names: a name
that folds onto an existing one would otherwise overwrite it.
ProfileError::DurabilityUnconfirmed means the profile is stored
and live; only whether it survives a power cut is unknown.
Sourcepub fn remove(&self, name: &SpeakerName) -> Result<bool, ProfileError>
pub fn remove(&self, name: &SpeakerName) -> Result<bool, ProfileError>
false when nobody by that name was enrolled.
Auto Trait Implementations§
impl Freeze for ProfileStore
impl RefUnwindSafe for ProfileStore
impl Send for ProfileStore
impl Sync for ProfileStore
impl Unpin for ProfileStore
impl UnsafeUnpin for ProfileStore
impl UnwindSafe for ProfileStore
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