pub struct ProfileStore { /* private fields */ }Expand description
ScenarioProfile の永続化ストア
Implementations§
Source§impl ProfileStore
impl ProfileStore
Sourcepub fn new(base_dir: impl AsRef<Path>) -> ProfileStore
pub fn new(base_dir: impl AsRef<Path>) -> ProfileStore
新規作成
Sourcepub fn default_path() -> Option<ProfileStore>
pub fn default_path() -> Option<ProfileStore>
デフォルトパスで作成
Sourcepub fn save(&self, profile: &ScenarioProfile) -> Result<(), ProfileStoreError>
pub fn save(&self, profile: &ScenarioProfile) -> Result<(), ProfileStoreError>
Profile を保存
Sourcepub fn load(
&self,
id: &ScenarioProfileId,
) -> Result<ScenarioProfile, ProfileStoreError>
pub fn load( &self, id: &ScenarioProfileId, ) -> Result<ScenarioProfile, ProfileStoreError>
Profile を読み込み
Sourcepub fn delete(&self, id: &ScenarioProfileId) -> Result<(), ProfileStoreError>
pub fn delete(&self, id: &ScenarioProfileId) -> Result<(), ProfileStoreError>
Profile を削除
Sourcepub fn exists(&self, id: &ScenarioProfileId) -> bool
pub fn exists(&self, id: &ScenarioProfileId) -> bool
Profile が存在するか
Sourcepub fn list_ids(&self) -> Result<Vec<ScenarioProfileId>, ProfileStoreError>
pub fn list_ids(&self) -> Result<Vec<ScenarioProfileId>, ProfileStoreError>
全 Profile ID を列挙
Sourcepub fn load_all(&self) -> Result<Vec<ScenarioProfile>, ProfileStoreError>
pub fn load_all(&self) -> Result<Vec<ScenarioProfile>, ProfileStoreError>
全 Profile を読み込み
Sourcepub fn save_component<C>(
&self,
id: &ScenarioProfileId,
component: &C,
) -> Result<(), ProfileStoreError>where
C: LearnedComponent,
pub fn save_component<C>(
&self,
id: &ScenarioProfileId,
component: &C,
) -> Result<(), ProfileStoreError>where
C: LearnedComponent,
Component を保存
Sourcepub fn load_component<C>(
&self,
id: &ScenarioProfileId,
) -> Result<C, ProfileStoreError>where
C: LearnedComponent,
pub fn load_component<C>(
&self,
id: &ScenarioProfileId,
) -> Result<C, ProfileStoreError>where
C: LearnedComponent,
Component を読み込み
Sourcepub fn delete_component<C>(
&self,
id: &ScenarioProfileId,
) -> Result<(), ProfileStoreError>where
C: LearnedComponent,
pub fn delete_component<C>(
&self,
id: &ScenarioProfileId,
) -> Result<(), ProfileStoreError>where
C: LearnedComponent,
Component を削除
Auto Trait Implementations§
impl Freeze for ProfileStore
impl RefUnwindSafe for ProfileStore
impl Send for ProfileStore
impl Sync for ProfileStore
impl Unpin 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
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