pub struct CountableStore {
owner: Uuid,
store: HashMap<CountableId, Countable>,
selection: Vec<CountableId>,
is_changed: RefCell<bool>,
}
Fields§
§owner: Uuid
§store: HashMap<CountableId, Countable>
§selection: Vec<CountableId>
§is_changed: RefCell<bool>
Implementations§
Source§impl CountableStore
impl CountableStore
pub fn new(owner: Uuid, store: HashMap<CountableId, Countable>) -> Self
pub fn owner(&self) -> Uuid
pub fn merge_checked(&mut self, other: Self) -> Result<(), AppError>
pub fn merge(&mut self, other: Self)
pub fn contains(&self, countable: &CountableId) -> bool
pub fn get(&self, countable: &CountableId) -> Option<Countable>
pub fn len(&self) -> usize
pub fn new_countable_checked( &mut self, name: &str, kind: CountableKind, parent: Option<CountableId>, ) -> Result<CountableId, AppError>
pub fn new_countable( &mut self, name: &str, kind: CountableKind, parent: Option<CountableId>, ) -> CountableId
pub fn filter(&self, filter: impl Fn(&Countable) -> bool) -> Self
pub fn raw_filter(&self, filter: impl Fn(&Countable) -> bool) -> Self
pub fn archive(&mut self, countable: &CountableId) -> Option<Countable>
pub fn root_nodes(&self) -> Vec<Countable>
pub fn nodes(&self) -> Vec<Countable>
pub fn has_child(&self, countable: &CountableId, child: &CountableId) -> bool
pub fn children_checked( &self, countable: &CountableId, ) -> Result<Vec<Countable>, AppError>
pub fn children(&self, countable: &CountableId) -> Vec<Countable>
pub fn parent_checked( &self, countable: &CountableId, ) -> Result<Option<Countable>, AppError>
pub fn parent(&self, countable: &CountableId) -> Option<Countable>
pub fn last_child_checked( &self, countable: &CountableId, ) -> Result<Countable, AppError>
pub fn last_child(&self, countable: &CountableId) -> Countable
pub fn kind_checked( &self, countable: &CountableId, ) -> Result<CountableKind, AppError>
pub fn kind(&self, countable: &CountableId) -> CountableKind
pub fn name_checked(&self, countable: &CountableId) -> Result<String, AppError>
pub fn name(&self, countable: &CountableId) -> String
pub fn set_name_checked( &self, countable: &CountableId, name: &str, ) -> Result<(), AppError>
pub fn set_name(&self, countable: &CountableId, name: &str)
pub fn count_checked(&self, countable: &CountableId) -> Result<i32, AppError>
pub fn count(&self, countable: &CountableId) -> i32
pub fn set_count_checked( &self, countable: &CountableId, count: i32, ) -> Result<(), AppError>
pub fn set_count(&self, countable: &CountableId, count: i32)
pub fn add_count_checked( &self, countable: &CountableId, add: i32, ) -> Result<(), AppError>
pub fn add_count(&self, countable: &CountableId, add: i32)
pub fn time_checked( &self, countable: &CountableId, ) -> Result<TimeDelta, AppError>
pub fn time(&self, countable: &CountableId) -> TimeDelta
pub fn set_time_checked( &self, countable: &CountableId, time: TimeDelta, ) -> Result<(), AppError>
pub fn set_time(&self, countable: &CountableId, time: TimeDelta)
pub fn add_time_checked( &self, countable: &CountableId, add: TimeDelta, ) -> Result<(), AppError>
pub fn add_time(&self, countable: &CountableId, add: TimeDelta)
pub fn hunttype_checked( &self, countable: &CountableId, ) -> Result<Hunttype, AppError>
pub fn hunttype(&self, countable: &CountableId) -> Hunttype
pub fn rolls_checked(&self, countable: &CountableId) -> Result<usize, AppError>
pub fn rolls(&self, countable: &CountableId) -> usize
pub fn odds_checked(&self, countable: &CountableId) -> Result<f64, AppError>
pub fn odds(&self, countable: &CountableId) -> f64
pub fn progress_checked(&self, countable: &CountableId) -> Result<f64, AppError>
pub fn progress(&self, countable: &CountableId) -> f64
pub fn completed_checked( &self, countable: &CountableId, ) -> Result<usize, AppError>
pub fn has_charm_checked( &self, countable: &CountableId, ) -> Result<bool, AppError>
pub fn has_charm(&self, countable: &CountableId) -> bool
pub fn is_success_checked( &self, countable: &CountableId, ) -> Result<bool, AppError>
pub fn is_success(&self, countable: &CountableId) -> bool
pub fn toggle_success_checked( &self, countable: &CountableId, ) -> Result<(), AppError>
pub fn toggle_success(&self, countable: &CountableId)
pub fn created_at_checked( &self, countable: &CountableId, ) -> Result<NaiveDateTime, AppError>
pub fn created_at(&self, countable: &CountableId) -> NaiveDateTime
Trait Implementations§
Source§impl Clone for CountableStore
impl Clone for CountableStore
Source§fn clone(&self) -> CountableStore
fn clone(&self) -> CountableStore
Returns a copy 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 moreSource§impl Debug for CountableStore
impl Debug for CountableStore
Source§impl Default for CountableStore
impl Default for CountableStore
Source§fn default() -> CountableStore
fn default() -> CountableStore
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CountableStore
impl<'de> Deserialize<'de> for CountableStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Savable for CountableStore
impl Savable for CountableStore
fn indexed_db_name(&self) -> String
fn save_indexed<'a>( &'a self, obj: ObjectStore<AppError>, ) -> Pin<Box<dyn Future<Output = Result<(), AppError>> + 'a>>
fn save_endpoint( &self, ) -> Pin<Box<dyn Future<Output = Result<(), ServerFnError>>>>
fn message(&self) -> Option<View>
fn clone_box(&self) -> Box<dyn Savable>
fn has_change(&self) -> bool
Auto Trait Implementations§
impl !Freeze for CountableStore
impl !RefUnwindSafe for CountableStore
impl Send for CountableStore
impl !Sync for CountableStore
impl Unpin for CountableStore
impl UnwindSafe for CountableStore
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> FromFormData for Twhere
T: DeserializeOwned,
impl<T> FromFormData for Twhere
T: DeserializeOwned,
Source§fn from_event(ev: &Event) -> Result<T, FromFormDataError>
fn from_event(ev: &Event) -> Result<T, FromFormDataError>
Tries to deserialize the data, given only the
submit
event.Source§impl<CustErr, T, Request> FromReq<Cbor, Request, CustErr> for T
impl<CustErr, T, Request> FromReq<Cbor, Request, CustErr> for T
Source§async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the arguments from a request.
Source§impl<CustErr, T, Request> FromReq<GetUrl, Request, CustErr> for T
impl<CustErr, T, Request> FromReq<GetUrl, Request, CustErr> for T
Source§async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the arguments from a request.
Source§impl<CustErr, T, Request> FromReq<Json, Request, CustErr> for T
impl<CustErr, T, Request> FromReq<Json, Request, CustErr> for T
Source§async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the arguments from a request.
Source§impl<CustErr, T, Request> FromReq<PostUrl, Request, CustErr> for T
impl<CustErr, T, Request> FromReq<PostUrl, Request, CustErr> for T
Source§async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
async fn from_req(req: Request) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the arguments from a request.
Source§impl<CustErr, T, Response> FromRes<Cbor, Response, CustErr> for T
impl<CustErr, T, Response> FromRes<Cbor, Response, CustErr> for T
Source§async fn from_res(res: Response) -> Result<T, ServerFnError<CustErr>>
async fn from_res(res: Response) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the outputs from a response.
Source§impl<CustErr, T, Response> FromRes<Json, Response, CustErr> for T
impl<CustErr, T, Response> FromRes<Json, Response, CustErr> for T
Source§async fn from_res(res: Response) -> Result<T, ServerFnError<CustErr>>
async fn from_res(res: Response) -> Result<T, ServerFnError<CustErr>>
Attempts to deserialize the outputs from a response.
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 moreSource§impl<CustErr, T, Response> IntoRes<Cbor, Response, CustErr> for T
impl<CustErr, T, Response> IntoRes<Cbor, Response, CustErr> for T
Source§async fn into_res(self) -> Result<Response, ServerFnError<CustErr>>
async fn into_res(self) -> Result<Response, ServerFnError<CustErr>>
Attempts to serialize the output into an HTTP response.
Source§impl<CustErr, T, Response> IntoRes<Json, Response, CustErr> for T
impl<CustErr, T, Response> IntoRes<Json, Response, CustErr> for T
Source§async fn into_res(self) -> Result<Response, ServerFnError<CustErr>>
async fn into_res(self) -> Result<Response, ServerFnError<CustErr>>
Attempts to serialize the output into an HTTP response.