Skip to main content

ChildRecord

Trait ChildRecord 

Source
pub trait ChildRecord: Resource<State: Model + Default> {
    type Parent: Resource;

    // Required methods
    fn container(parent: &<Self::Parent as Resource>::State) -> &Container;
    fn container_path() -> Vec<Segment>;

    // Provided methods
    fn parent_record() -> RecordId { ... }
    fn check_group(
        parent: &<Self::Parent as Resource>::State,
        group: Option<&Id>,
    ) -> Result<(), String> { ... }
}
Expand description

A resource whose records are children a record lists. See the module docs.

Required Associated Types§

Source

type Parent: Resource

The resource whose record lists these children.

Required Methods§

Source

fn container(parent: &<Self::Parent as Resource>::State) -> &Container

The container of the parent that lists them.

Source

fn container_path() -> Vec<Segment>

Where the container is in the parent’s document: its field.

Provided Methods§

Source

fn parent_record() -> RecordId

The record that lists them: the app’s own record in its workspace.

Source

fn check_group( parent: &<Self::Parent as Resource>::State, group: Option<&Id>, ) -> Result<(), String>

Refuse a place the parent does not have for one of these: under a group of the wrong kind (a channel inside a channel). Allows any listed group by default.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§