pub struct Derived<R> { /* private fields */ }Expand description
One derived resource. See the module docs.
Implementations§
Source§impl<R> Derived<R>
impl<R> Derived<R>
Sourcepub fn new(label: impl Into<String>) -> Self
pub fn new(label: impl Into<String>) -> Self
A derived resource named label, identified by it among its
siblings.
Sourcepub fn with_child(self, child: Self) -> Self
pub fn with_child(self, child: Self) -> Self
Nest child beneath it (a table’s cells), identified within it.
Sourcepub fn of_kind(self, kind: impl Into<String>) -> Self
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.
Sourcepub fn typed<T: RowType>(self) -> Self
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.
Sourcepub fn with_operation(self, spec: ActionSpec) -> Self
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.
Sourcepub fn with_effect<E: Effect>(self, effect: &E) -> Self
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).
Sourcepub fn with_effect_asking<E: Effect>(self, effect: &E, asking: &[&str]) -> Self
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).
Sourcepub fn identified(self, id: impl Into<String>) -> Self
pub fn identified(self, id: impl Into<String>) -> Self
Identify it by id rather than its label, when the label can change.
Sourcepub fn addressed(self, id: impl Into<String>) -> Self
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>).
Sourcepub fn in_field(self, field: impl Into<String>) -> Self
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").
pub fn id(&self) -> &str
pub fn label(&self) -> &str
Source§impl<R: Resource> Derived<R>
impl<R: Resource> Derived<R>
Sourcepub fn with_edit(
self,
id: &'static str,
label: impl Into<String>,
edit: Edit<R>,
) -> Self
pub fn with_edit( self, id: &'static str, label: impl Into<String>, edit: Edit<R>, ) -> Self
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.
Sourcepub 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,
) -> Selfwhere
V: DeserializeOwned + JsonSchema,
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,
) -> Selfwhere
V: DeserializeOwned + JsonSchema,
Offer a field edit whose one value its caller supplies
(ActionDecl::edit_asking): “Rename playlist” on the playlist.
Sourcepub fn publish(&self) -> ResourceSpec
pub fn publish(&self) -> ResourceSpec
The child resource this is published as.
Sourcepub fn find(derived: &[Self], id: &str) -> Option<ResourceSpec>
pub fn find(derived: &[Self], id: &str) -> Option<ResourceSpec>
The published resource id among derived and their children.
Trait Implementations§
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>
impl<R> Move for Derived<R>
impl<R> Unpin for Derived<R>
impl<R> UnsafeUnpin for Derived<R>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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