Skip to main content

Entry

Struct Entry 

Source
pub struct Entry { /* private fields */ }
Available on crate feature calendar only.
Expand description

Something on the calendar: a meeting, a deadline, a holiday.

Implementations§

Source§

impl Entry

Source

pub fn new( id: EntryId, title: impl Into<String>, start: Timestamp, end: Timestamp, ) -> Self

A timed entry from start up to end.

Source

pub fn all_day( id: EntryId, title: impl Into<String>, first: Date, last: Date, ) -> Self

An entry covering whole days, first to last inclusive.

Source

pub fn at(id: EntryId, title: impl Into<String>, when: When) -> Self

An entry covering when.

Source

pub fn icon(self, glyph: Glyph) -> Self

A small glyph in the muted text colour, drawn before the time or title in every view and never cut off, such as a mail icon for an unanswered invitation.

Source

pub fn icon_label(self, label: impl Into<String>) -> Self

What the icon means, shown as a tooltip on it, such as “Team entry”. Blank text clears it.

Source

pub fn icon_label_of(&self) -> Option<&str>

Source

pub fn emphasis(self, emphasis: Emphasis) -> Self

Source

pub fn locked(self, locked: bool) -> Self

A locked entry can be selected and opened, but the calendar’s own gestures and shortcuts never move, resize or remove it. The app can still change it with Event::Insert. It is both not movable and not removable, whatever those are set to.

Source

pub fn movable(self, movable: bool) -> Self

Whether the calendar’s own drags and shortcuts may move or resize the entry: dragging it in any view, its edges in the hours, and Event::Reschedule and Event::MoveDays. On by default. Turning it off leaves the entry removable, such as for an invitation that can be deleted but not rescheduled.

Source

pub fn removable(self, removable: bool) -> Self

Whether the calendar’s Delete shortcut and Event::Delete may remove the entry. On by default. Turning it off leaves the entry movable. The app can still remove it with Event::Remove.

Source

pub fn location(self, location: impl Into<String>) -> Self

Where the entry takes place. Blank text clears it.

Source

pub fn notes(self, notes: impl Into<String>) -> Self

Free text kept with the entry exactly as given, which may run over several lines. Blank text clears it.

Source

pub fn tone(self, tone: Tone) -> Self

Source

pub fn colour(self, colour: impl Into<Option<Color>>) -> Self

A colour of the app’s own, such as the colour of the calendar the entry belongs to, drawn instead of its Tone in every view and theme. Its alpha is ignored, a colour too close to the background to see is moved until its marks show, and text on it is kept readable; see style::paint. None goes back to the tone.

Source

pub fn tag(self, tag: impl Into<String>) -> Self

A label that triggers can be limited to, such as "work". See Scope::Tagged.

Source

pub fn repeat(self, repeat: Repeat) -> Self

Makes the entry repeat. Every occurrence keeps the length of the first.

Source

pub fn titled(self, title: impl Into<String>) -> Self

Replaces the title.

Source

pub fn rescheduled(self, when: When) -> Self

Moves the entry. A repeating entry moves as a whole, since when is its first occurrence.

Source

pub fn id(&self) -> EntryId

Source

pub fn title(&self) -> &str

Source

pub fn when(&self) -> When

When the entry, or its first occurrence, happens.

Source

pub fn tone_of(&self) -> Tone

Source

pub fn colour_of(&self) -> Option<Color>

The colour set with colour, if any.

Source

pub fn paint_of(&self) -> Paint

What the entry is drawn in: its colour when it has one, otherwise its tone.

Source

pub fn tag_of(&self) -> Option<&str>

Source

pub fn repeat_of(&self) -> Option<Repeat>

Source

pub fn location_of(&self) -> Option<&str>

Source

pub fn notes_of(&self) -> Option<&str>

Source

pub fn is_all_day(&self) -> bool

Source

pub fn icon_of(&self) -> Option<Glyph>

Source

pub fn emphasis_of(&self) -> Emphasis

Source

pub fn is_locked(&self) -> bool

Source

pub fn is_movable(&self) -> bool

Whether the entry may be moved or resized: it is movable and not locked.

Source

pub fn is_removable(&self) -> bool

Whether the entry may be removed: it is removable and not locked.

Trait Implementations§

Source§

impl Clone for Entry

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Entry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Entry

Source§

impl PartialEq for Entry

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Entry

Auto Trait Implementations§

§

impl Forget for Entry

§

impl Freeze for Entry
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const Marker is !null: Freeze, PhantomData<Marker>: Freeze,

§

impl Move for Entry

§

impl RefUnwindSafe for Entry

§

impl Send for Entry
where RawVecInner: Send, BoxRaw<Marker>: Send,

§

impl Sync for Entry
where RawVecInner: Sync, BoxRaw<Marker>: Sync,

§

impl Unpin for Entry
where *const u8 is !null: Unpin, Box<Marker>: Unpin,

§

impl UnsafeUnpin for Entry

§

impl UnwindSafe for Entry
where RawVecInner: UnwindSafe, BoxRaw<Marker>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<State, Message> IntoBoot<State, Message> for State

Source§

fn into_boot(self) -> (State, Task<Message>)

Turns some type into the initial state of some Application.
Source§

impl<T> MaybeClone for T

Source§

impl<T> MaybeDebug for T

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more