Struct Surface
pub struct Surface {
pub kind: String,
pub label: String,
pub version: u32,
pub person: bool,
pub verbs: Vec<VerbSurface>,
pub fields: Vec<FieldSurface>,
}Expand description
The public surface of one resource kind. See the module docs.
Fields§
§kind: String§label: String§version: u32The storage version (#[resource(version = N)]).
person: boolA record of the person’s own, kept in their room rather than the
room of the window showing it: one the app opens beside its own
record (its ResourceApp::records). Only the kinds an app’s surface
marks so may it keep in, or read from, the person’s room.
verbs: Vec<VerbSurface>Absent from a surface file that lists none.
fields: Vec<FieldSurface>Every stored field, depth first; empty for a resource without a model shape.
Implementations§
§impl Surface
What a receiver without the app reads from its surface: each verb’s kind
and tree field, which paths offer field edits, and which storage units
an action may write (* for any item).
impl Surface
What a receiver without the app reads from its surface: each verb’s kind
and tree field, which paths offer field edits, and which storage units
an action may write (* for any item).
pub fn verb(&self, action: &str) -> Option<(ActionKind, Option<String>)>
pub fn verb(&self, action: &str) -> Option<(ActionKind, Option<String>)>
The kind of the verb action and the field it sits under, or None
when the app publishes no such verb.
pub fn editable(&self, path: &[PathStep]) -> bool
pub fn editable(&self, path: &[PathStep]) -> bool
Whether the field at path offers edits: stored, and neither it nor
a field above it read-only.
Trait Implementations§
§impl<'de> Deserialize<'de> for Surface
impl<'de> Deserialize<'de> for Surface
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Surface, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Surface, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for Surface
impl Serialize for Surface
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Surface
Auto Trait Implementations§
impl Freeze for Surface
impl RefUnwindSafe for Surface
impl Send for Surface
impl Sync for Surface
impl Unpin for Surface
impl UnsafeUnpin for Surface
impl UnwindSafe for Surface
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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