pub struct ScenarioRegistry { /* private fields */ }Expand description
マルチシナリオ管理
Implementations§
Source§impl ScenarioRegistry
impl ScenarioRegistry
Sourcepub fn new(store: ProfileStore) -> ScenarioRegistry
pub fn new(store: ProfileStore) -> ScenarioRegistry
新規作成
Sourcepub fn load_all(&mut self) -> Result<(), RegistryError>
pub fn load_all(&mut self) -> Result<(), RegistryError>
ストアから全 Profile を読み込み
Sourcepub fn register(
&mut self,
profile: ScenarioProfile,
) -> Result<(), RegistryError>
pub fn register( &mut self, profile: ScenarioProfile, ) -> Result<(), RegistryError>
Profile を登録
Sourcepub fn get(&self, id: &ScenarioProfileId) -> Option<&ScenarioProfile>
pub fn get(&self, id: &ScenarioProfileId) -> Option<&ScenarioProfile>
Profile を取得
Sourcepub fn get_mut(
&mut self,
id: &ScenarioProfileId,
) -> Option<&mut ScenarioProfile>
pub fn get_mut( &mut self, id: &ScenarioProfileId, ) -> Option<&mut ScenarioProfile>
Profile を取得(可変)
Sourcepub fn remove(&mut self, id: &ScenarioProfileId) -> Result<(), RegistryError>
pub fn remove(&mut self, id: &ScenarioProfileId) -> Result<(), RegistryError>
Profile を削除
Sourcepub fn all_profiles(&self) -> impl Iterator<Item = &ScenarioProfile>
pub fn all_profiles(&self) -> impl Iterator<Item = &ScenarioProfile>
全 Profile を取得
Sourcepub fn usable_profiles(&self) -> impl Iterator<Item = &ScenarioProfile>
pub fn usable_profiles(&self) -> impl Iterator<Item = &ScenarioProfile>
使用可能な Profile を取得
Sourcepub fn save(&self, id: &ScenarioProfileId) -> Result<(), RegistryError>
pub fn save(&self, id: &ScenarioProfileId) -> Result<(), RegistryError>
Profile を保存(更新後)
Sourcepub fn add_matcher(&mut self, matcher: TaskMatcher)
pub fn add_matcher(&mut self, matcher: TaskMatcher)
TaskMatcher を追加
Sourcepub fn select_for_task(
&self,
task: &str,
) -> Result<&ScenarioProfile, RegistryError>
pub fn select_for_task( &self, task: &str, ) -> Result<&ScenarioProfile, RegistryError>
Task に対応する Profile を選択
Sourcepub fn candidates_for_task(&self, task: &str) -> Vec<&ScenarioProfile>
pub fn candidates_for_task(&self, task: &str) -> Vec<&ScenarioProfile>
Task に対応する全候補 Profile を取得
Sourcepub fn profile_count(&self) -> usize
pub fn profile_count(&self) -> usize
登録されている Profile 数
Sourcepub fn usable_count(&self) -> usize
pub fn usable_count(&self) -> usize
使用可能な Profile 数
Sourcepub fn matcher_count(&self) -> usize
pub fn matcher_count(&self) -> usize
Matcher 数
Sourcepub fn count_by_state(&self) -> HashMap<ProfileState, usize>
pub fn count_by_state(&self) -> HashMap<ProfileState, usize>
状態別 Profile 数
Auto Trait Implementations§
impl Freeze for ScenarioRegistry
impl RefUnwindSafe for ScenarioRegistry
impl Send for ScenarioRegistry
impl Sync for ScenarioRegistry
impl Unpin for ScenarioRegistry
impl UnwindSafe for ScenarioRegistry
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> 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