Skip to main content

Derived

Struct Derived 

Source
pub struct Derived<R> { /* private fields */ }
Expand description

One derived resource. See the module docs.

Implementations§

Source§

impl<R> Derived<R>

Source

pub fn new(label: impl Into<String>) -> Self

A derived resource named label, identified by it among its siblings.

Source

pub fn with_child(self, child: Self) -> Self

Nest child beneath it (a table’s cells), identified within it.

Source

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

What kind of thing it is among the record’s derived resources (folder, tag), published as <record kind>.<kind>; a kind that names its own namespace (music.track) is published as it is.

Source

pub fn typed<T: RowType>(self) -> Self

Say what the place is as people name it: it is an entity of the declared row type R, so search names it by R’s words and LiveRow::declared publishes it as a row of that type.

Source

pub fn with_operation(self, spec: ActionSpec) -> Self

Offer spec, an operation of the row as the row stands now: its label follows what it shows (Play/Pause), and one that cannot act offers its reason (tilo_actions::ActionSpec::unavailable). Self::with_effect offers the effect as its declaration reads.

Source

pub fn with_effect<E: Effect>(self, effect: &E) -> Self

Offer the effect effect on it, its arguments bound (a view that reveals the folder).

Source

pub fn with_effect_asking<E: Effect>(self, effect: &E, asking: &[&str]) -> Self

Offer the effect effect on it with the arguments named in asking left to its caller, the rest bound (select a passage of this book, from a chapter the caller names).

Source

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

Identify it by id rather than its label, when the label can change.

Source

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

Publish it under id as a whole rather than as a name among the record’s derived resources: for a row that already has an address of its own, which a search hit, a script or an agent names as it was named before (music.track:<id>).

Source

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

Publish it as an item of the record’s field (a document’s paragraphs, blocks), as <record kind>/<field>/<id>: what a place parameter naming that field takes (place = "blocks").

Source

pub fn with(self, action: Bound<R>) -> Self

Offer action on it.

Source

pub fn id(&self) -> &str

Source

pub fn label(&self) -> &str

Source§

impl<R: Resource> Derived<R>

Source

pub fn with_edit( self, id: &'static str, label: impl Into<String>, edit: Edit<R>, ) -> Self
where Edit<R>: Send + Sync,

Offer the field edit edit on it as the action id labelled label, its value bound (“Use Proton for Adobe Reader” on the app it routes): the same edit, checked and recorded as any other.

Source

pub fn with_edit_asking<V>( self, id: &'static str, label: impl Into<String>, param: &'static str, description: &'static str, make: impl Fn(V) -> Edit<R> + Send + Sync + 'static, ) -> Self

Offer a field edit whose one value its caller supplies (ActionDecl::edit_asking): “Rename playlist” on the playlist.

Source

pub fn publish(&self) -> ResourceSpec

The child resource this is published as.

Source

pub fn find(derived: &[Self], id: &str) -> Option<ResourceSpec>

The published resource id among derived and their children.

Trait Implementations§

Source§

impl<R> Clone for Derived<R>

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<R> PartialEq for Derived<R>

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

Auto Trait Implementations§

§

impl<R> !RefUnwindSafe for Derived<R>

§

impl<R> !Send for Derived<R>

§

impl<R> !Sync for Derived<R>

§

impl<R> !UnwindSafe for Derived<R>

§

impl<R> Forget for Derived<R>

§

impl<R> Freeze for Derived<R>
where PhantomData<fn() -> R>: Freeze,

§

impl<R> Move for Derived<R>

§

impl<R> Unpin for Derived<R>
where PhantomData<fn() -> R>: Unpin,

§

impl<R> UnsafeUnpin for Derived<R>
where PhantomData<fn() -> R>: UnsafeUnpin,

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<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> 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<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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