[−][src]Struct rtw::OngoingActivity
A started and unfinished activity (no stop time)
Fields
start_time: DateTimeW
start time
Activity tags
Methods
impl OngoingActivity
[src]
pub fn new(start_time: DateTimeW, tags: Tags) -> Self
[src]
Constructor
pub fn get_start_time(&self) -> DateTimeW
[src]
Start time getter
pub fn get_title(&self) -> String
[src]
Return title (activity tags joined by a space)
let activity = OngoingActivity::new(chrono::Local::now().into(), vec![String::from("foo"), String::from("bar")]); assert_eq!(activity.get_title(), "foo bar");
pub fn into_activity(self, stop_time: DateTimeW) -> Result<Activity>
[src]
Convert active activity to finished activity
let activity = OngoingActivity::new(chrono::Local::now().into(), vec![String::from("foo"), String::from("bar")]); let finished: Activity = activity.into_activity(chrono::Local::now().into()).unwrap();
stop_time
should be >= start_time
otherwise error
Trait Implementations
impl Clone for OngoingActivity
[src]
fn clone(&self) -> OngoingActivity
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for OngoingActivity
[src]
impl<'de> Deserialize<'de> for OngoingActivity
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for OngoingActivity
[src]
Auto Trait Implementations
impl RefUnwindSafe for OngoingActivity
impl Send for OngoingActivity
impl Sync for OngoingActivity
impl Unpin for OngoingActivity
impl UnwindSafe for OngoingActivity
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,