pub struct Query<'a, T, E, F: Fn()> {
pub data: &'a ReadSignal<QueryData<Rc<T>, Rc<E>>>,
pub status: Rc<Signal<Status>>,
pub refetch: &'a F,
}Expand description
The struct representing a query
§Example
let Query { data, status, refetch } = use_query(
cx,
("hello", "World"),
|| async { Result::<_, ()>::Ok("World".to_string()) }
);
Fields§
§data: &'a ReadSignal<QueryData<Rc<T>, Rc<E>>>The data returned by the query. See QueryData.
status: Rc<Signal<Status>>The status of the query. See Status.
refetch: &'a FA function to trigger a refetch of the query and all queries with the same key.
Auto Trait Implementations§
impl<'a, T, E, F> Freeze for Query<'a, T, E, F>
impl<'a, T, E, F> !RefUnwindSafe for Query<'a, T, E, F>
impl<'a, T, E, F> !Send for Query<'a, T, E, F>
impl<'a, T, E, F> !Sync for Query<'a, T, E, F>
impl<'a, T, E, F> Unpin for Query<'a, T, E, F>
impl<'a, T, E, F> !UnwindSafe for Query<'a, T, E, F>
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
Mutably borrows from an owned value. Read more