Struct SearchRequest
pub struct SearchRequest {
pub part: Option<ScopeDecl>,
pub query: Option<String>,
pub offer: Option<SearchOffer>,
pub action: Option<String>,
pub anchor: Option<Anchor>,
}Expand description
A request to open the platform search from inside an app.
Fields§
§part: Option<ScopeDecl>The part of the app to search (see ScopeDecl); the whole app when
absent.
query: Option<String>Text the search field starts with, selected so typing replaces it:
the argument an asked action starts from (SearchRequest::asking).
offer: Option<SearchOffer>One of the system’s own actions the app prepares for the person: search opens on it with these arguments, and nothing runs until the person confirms it there. A host that offers no such action opens a plain search.
action: Option<String>One of the app’s own published actions, on the resource the scope names: search opens on it, asking for its arguments, a parameter picked from the workspace on its picker. Nothing runs until the person has answered them.
anchor: Option<Anchor>A resource of the app’s to open on, selected: the row that shows it is
the one under the cursor, so pressing Enter opens it (see
SearchRequest::on). A host that does not know the resource opens a
plain search of the app.
Implementations§
§impl SearchRequest
impl SearchRequest
pub fn this_app() -> SearchRequest
pub fn this_app() -> SearchRequest
Search everything this app publishes.
pub fn within(scope: ScopeDecl) -> SearchRequest
pub fn within(scope: ScopeDecl) -> SearchRequest
Search one part of this app.
pub fn on(
resource: impl Into<String>,
query: impl Into<String>,
) -> SearchRequest
pub fn on( resource: impl Into<String>, query: impl Into<String>, ) -> SearchRequest
Open search on resource, a resource of this app’s, with query the
text that finds its row: that row is under the cursor, so one Enter
opens it. How an app shows the person something it has instead of
describing it.
pub fn asking(scope: ScopeDecl, action: impl Into<String>) -> SearchRequest
pub fn asking(scope: ScopeDecl, action: impl Into<String>) -> SearchRequest
Open search on action, a published action of the resource scope
names, asking for its arguments (see SearchRequest::action): a
button whose action needs what the person picks (“Link a note”)
opens straight on the picker.
pub fn asked(&self) -> Option<ActionAddress>
pub fn asked(&self) -> Option<ActionAddress>
The action this request opens search on, by its address
(SearchRequest::asking).
pub fn offering<K, V>(
action: impl Into<String>,
arguments: impl IntoIterator<Item = (K, V)>,
) -> SearchRequest
pub fn offering<K, V>( action: impl Into<String>, arguments: impl IntoIterator<Item = (K, V)>, ) -> SearchRequest
Open search on the system’s action action, with arguments filled
in for the person to confirm (see SearchRequest::offer).
pub fn with_query(self, query: impl Into<String>) -> SearchRequest
pub fn with_query(self, query: impl Into<String>) -> SearchRequest
Start the search with query already typed.
pub fn anchored(&self) -> Option<&Anchor>
pub fn anchored(&self) -> Option<&Anchor>
The resource this search opens on (SearchRequest::on), when the
host should select it: a resource and a query both named.
pub fn part(&self) -> Option<&ScopeDecl>
pub fn from_arguments(arguments: &Map<String, Value>) -> SearchRequest
pub fn from_arguments(arguments: &Map<String, Value>) -> SearchRequest
The request the open action’s arguments describe. Unknown or
mistyped arguments read as absent.
Trait Implementations§
§impl Clone for SearchRequest
impl Clone for SearchRequest
§fn clone(&self) -> SearchRequest
fn clone(&self) -> SearchRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for SearchRequest
impl Debug for SearchRequest
§impl Default for SearchRequest
impl Default for SearchRequest
§fn default() -> SearchRequest
fn default() -> SearchRequest
§impl<'de> Deserialize<'de> for SearchRequestwhere
SearchRequest: Default,
impl<'de> Deserialize<'de> for SearchRequestwhere
SearchRequest: Default,
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SearchRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SearchRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for SearchRequest
impl PartialEq for SearchRequest
§impl Serialize for SearchRequest
impl Serialize for SearchRequest
§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 Eq for SearchRequest
impl StructuralPartialEq for SearchRequest
Auto Trait Implementations§
impl Freeze for SearchRequest
impl RefUnwindSafe for SearchRequest
impl Send for SearchRequest
impl Sync for SearchRequest
impl Unpin for SearchRequest
impl UnsafeUnpin for SearchRequest
impl UnwindSafe for SearchRequest
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> 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> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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