pub struct ProfileStore { /* private fields */ }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) -> Vec<Profile>
pub fn read_all(&self) -> Vec<Profile>
Every readable profile, sorted by name.
A profile that will not load is skipped with a warning: one unreadable file must not cost a session every other enrolled voice. A directory that does not exist means nobody has enrolled, which is ordinary.
Sourcepub fn read_for(&self, engine: &str, dimension: usize) -> Vec<Profile>
pub fn read_for(&self, engine: &str, dimension: usize) -> Vec<Profile>
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.