Struct PublishedDirectory
pub struct PublishedDirectory { /* private fields */ }Expand description
The directory of a host that publishes its whole resource tree at once: the snapshot of what it last published, under a revision that changes whenever that does. Pages continue from a cursor that names the revision, the request and the offset, so it holds nothing per caller.
Implementations§
§impl PublishedDirectory
impl PublishedDirectory
pub fn publish(
&mut self,
resources: &[ResourceSpec],
descriptors: &[ActionDescriptor],
)
pub fn publish( &mut self, resources: &[ResourceSpec], descriptors: &[ActionDescriptor], )
Take resources, whose actions descriptors describe, as what the
directory answers from. Its revision moves only when the directory
does.
pub fn withdraw(&mut self)
pub fn withdraw(&mut self)
Answer nothing until the next publication.
pub fn page(&self, query: &ActionDirectoryQuery) -> ActionDirectoryPage
pub fn page(&self, query: &ActionDirectoryQuery) -> ActionDirectoryPage
The page query asks for.
pub fn resolve(
&self,
revision: &str,
resource: &str,
action: &str,
) -> ActionDirectoryResolution
pub fn resolve( &self, revision: &str, resource: &str, action: &str, ) -> ActionDirectoryResolution
The row of resource’s action action, at revision, or at the
current revision for an empty one.
pub fn answer(&self, request: ActionDirectoryRequest)
pub fn answer(&self, request: ActionDirectoryRequest)
Answer request. A host that publishes this way pins no revision
for local input, so there is no local mutation for it to explain.
pub fn answer_refreshed(
&self,
request: ActionDirectoryRequest,
refresh: impl FnMut(&mut ActionDirectoryRow),
)
pub fn answer_refreshed( &self, request: ActionDirectoryRequest, refresh: impl FnMut(&mut ActionDirectoryRow), )
PublishedDirectory::answer, after refresh has said of each row
about to answer what only the app knows now: whether an action can
run. A snapshot is built when the surface does and answered from
until it moves, so an answer’s state is read here, for the rows the
caller asked about, and never for the surface whole.
Trait Implementations§
§impl Default for PublishedDirectory
impl Default for PublishedDirectory
§fn default() -> PublishedDirectory
fn default() -> PublishedDirectory
Auto Trait Implementations§
impl !Freeze for PublishedDirectory
impl !RefUnwindSafe for PublishedDirectory
impl Send for PublishedDirectory
impl !Sync for PublishedDirectory
impl Unpin for PublishedDirectory
impl UnsafeUnpin for PublishedDirectory
impl UnwindSafe for PublishedDirectory
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
§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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend 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