Skip to main content

SyncView

Struct SyncView 

Source
pub struct SyncView<T>
where T: ?Sized,
{ /* private fields */ }
🔬This is a nightly-only experimental API. (exclusive_wrapper)
Expand description

SyncView provides mutable access, also referred to as exclusive access to the underlying value. However, it only permits immutable, or shared access to the underlying value when that value is Sync.

While this may seem not very useful, it allows SyncView to unconditionally implement Sync. Indeed, the safety requirements of Sync state that for SyncView to be Sync, it must be sound to share across threads, that is, it must be sound for &SyncView to cross thread boundaries. By design, a &SyncView<T> for non-Sync T has no API whatsoever, making it useless, thus harmless, thus memory safe.

Certain constructs like Futures can only be used with exclusive access, and are often Send but not Sync, so SyncView can be used as hint to the Rust compiler that something is Sync in practice.

§Examples

Using a non-Sync future prevents the wrapping struct from being Sync:

use core::cell::Cell;

async fn other() {}
fn assert_sync<T: Sync>(t: T) {}
struct State<F> {
    future: F
}

assert_sync(State {
    future: async {
        let cell = Cell::new(1);
        let cell_ref = &cell;
        other().await;
        let value = cell_ref.get();
    }
});

SyncView ensures the struct is Sync without stripping the future of its functionality:

#![feature(exclusive_wrapper)]
use core::cell::Cell;
use core::sync::SyncView;

async fn other() {}
fn assert_sync<T: Sync>(t: T) {}
struct State<F> {
    future: SyncView<F>
}

assert_sync(State {
    future: SyncView::new(async {
        let cell = Cell::new(1);
        let cell_ref = &cell;
        other().await;
        let value = cell_ref.get();
    })
});

§Parallels with a mutex

In some sense, SyncView can be thought of as a compile-time version of a mutex, as the borrow-checker guarantees that only one &mut can exist for any value. This is a parallel with the fact that & and &mut references together can be thought of as a compile-time version of a read-write lock.

Implementations§

Source§

impl<T> SyncView<T>

Source

pub const fn new(t: T) -> SyncView<T>

🔬This is a nightly-only experimental API. (exclusive_wrapper)

Wrap a value in an SyncView

Source

pub const fn into_inner(self) -> T

🔬This is a nightly-only experimental API. (exclusive_wrapper)

Unwrap the value contained in the SyncView

Source§

impl<T> SyncView<T>
where T: ?Sized,

Source

pub const fn as_pin_mut(self: Pin<&mut SyncView<T>>) -> Pin<&mut T>

🔬This is a nightly-only experimental API. (exclusive_wrapper)

Gets pinned exclusive access to the underlying value.

SyncView is considered to structurally pin the underlying value, which means unpinned SyncViews can produce unpinned access to the underlying value, but pinned SyncViews only produce pinned access to the underlying value.

Source

pub const fn from_mut(r: &mut T) -> &mut SyncView<T>

🔬This is a nightly-only experimental API. (exclusive_wrapper)

Build a mutable reference to an SyncView<T> from a mutable reference to a T. This allows you to skip building an SyncView with SyncView::new.

Source

pub const fn from_pin_mut(r: Pin<&mut T>) -> Pin<&mut SyncView<T>>

🔬This is a nightly-only experimental API. (exclusive_wrapper)

Build a pinned mutable reference to an SyncView<T> from a pinned mutable reference to a T. This allows you to skip building an SyncView with SyncView::new.

Source§

impl<T> SyncView<T>
where T: Sync + ?Sized,

Source

pub const fn as_pin(self: Pin<&SyncView<T>>) -> Pin<&T>

🔬This is a nightly-only experimental API. (exclusive_wrapper)

Gets pinned shared access to the underlying value.

SyncView is considered to structurally pin the underlying value, which means unpinned SyncViews can produce unpinned access to the underlying value, but pinned SyncViews only produce pinned access to the underlying value.

Trait Implementations§

Source§

impl<T> AsMut<T> for SyncView<T>
where T: ?Sized,

Source§

fn as_mut(&mut self) -> &mut T

Gets exclusive access to the underlying value.

Source§

impl<T> AsRef<T> for SyncView<T>
where T: Sync + ?Sized,

Source§

fn as_ref(&self) -> &T

Gets shared access to the underlying value.

Source§

impl<F, Args> AsyncFn<Args> for SyncView<F>
where F: Sync + AsyncFn<Args>, Args: Tuple,

Source§

extern "rust-call" fn async_call( &self, args: Args, ) -> <SyncView<F> as AsyncFnMut<Args>>::CallRefFuture<'_>

🔬This is a nightly-only experimental API. (async_fn_traits)
Call the AsyncFn, returning a future which may borrow from the called closure.
Source§

impl<F, Args> AsyncFnMut<Args> for SyncView<F>
where F: AsyncFnMut<Args>, Args: Tuple,

Source§

type CallRefFuture<'a> = <F as AsyncFnMut<Args>>::CallRefFuture<'a> where F: 'a

🔬This is a nightly-only experimental API. (async_fn_traits)
Source§

extern "rust-call" fn async_call_mut( &mut self, args: Args, ) -> <SyncView<F> as AsyncFnMut<Args>>::CallRefFuture<'_>

🔬This is a nightly-only experimental API. (async_fn_traits)
Call the AsyncFnMut, returning a future which may borrow from the called closure.
Source§

impl<F, Args> AsyncFnOnce<Args> for SyncView<F>
where F: AsyncFnOnce<Args>, Args: Tuple,

Source§

type CallOnceFuture = <F as AsyncFnOnce<Args>>::CallOnceFuture

🔬This is a nightly-only experimental API. (async_fn_traits)
Future returned by AsyncFnOnce::async_call_once.
Source§

type Output = <F as AsyncFnOnce<Args>>::Output

🔬This is a nightly-only experimental API. (async_fn_traits)
Output type of the called closure’s future.
Source§

extern "rust-call" fn async_call_once( self, args: Args, ) -> <SyncView<F> as AsyncFnOnce<Args>>::CallOnceFuture

🔬This is a nightly-only experimental API. (async_fn_traits)
Call the AsyncFnOnce, returning a future which may move out of the called closure.
Source§

impl<T> Clone for SyncView<T>
where T: Sync + Clone,

Source§

fn clone(&self) -> SyncView<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R, G> Coroutine<R> for SyncView<G>
where G: Coroutine<R> + ?Sized,

Source§

type Yield = <G as Coroutine<R>>::Yield

🔬This is a nightly-only experimental API. (coroutine_trait)
The type of value this coroutine yields. Read more
Source§

type Return = <G as Coroutine<R>>::Return

🔬This is a nightly-only experimental API. (coroutine_trait)
The type of value this coroutine returns. Read more
Source§

fn resume( self: Pin<&mut SyncView<G>>, arg: R, ) -> CoroutineState<<SyncView<G> as Coroutine<R>>::Yield, <SyncView<G> as Coroutine<R>>::Return>

🔬This is a nightly-only experimental API. (coroutine_trait)
Resumes the execution of this coroutine. Read more
Source§

impl<T> Debug for SyncView<T>
where T: ?Sized,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Default for SyncView<T>
where T: Default,

Source§

fn default() -> SyncView<T>

Returns the “default value” for a type. Read more
Source§

impl<F, Args> Fn<Args> for SyncView<F>
where F: Sync + Fn<Args>, Args: Tuple,

Source§

extern "rust-call" fn call( &self, args: Args, ) -> <SyncView<F> as FnOnce<Args>>::Output

🔬This is a nightly-only experimental API. (fn_traits)
Performs the call operation.
Source§

impl<F, Args> FnMut<Args> for SyncView<F>
where F: FnMut<Args>, Args: Tuple,

Source§

extern "rust-call" fn call_mut( &mut self, args: Args, ) -> <SyncView<F> as FnOnce<Args>>::Output

🔬This is a nightly-only experimental API. (fn_traits)
Performs the call operation.
Source§

impl<F, Args> FnOnce<Args> for SyncView<F>
where F: FnOnce<Args>, Args: Tuple,

Source§

type Output = <F as FnOnce<Args>>::Output

The returned type after the call operator is used.
Source§

extern "rust-call" fn call_once( self, args: Args, ) -> <SyncView<F> as FnOnce<Args>>::Output

🔬This is a nightly-only experimental API. (fn_traits)
Performs the call operation.
Source§

impl<T> From<T> for SyncView<T>

Source§

fn from(t: T) -> SyncView<T>

Converts to this type from the input type.
Source§

impl<T> Future for SyncView<T>
where T: Future + ?Sized,

Source§

type Output = <T as Future>::Output

The type of value produced on completion.
Source§

fn poll( self: Pin<&mut SyncView<T>>, cx: &mut Context<'_>, ) -> Poll<<SyncView<T> as Future>::Output>

Attempts to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
Source§

impl<T> Hash for SyncView<T>
where T: Sync + Hash + ?Sized,

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T> Ord for SyncView<T>
where T: Sync + Ord + ?Sized,

Source§

fn cmp(&self, other: &SyncView<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T, U> PartialEq<SyncView<U>> for SyncView<T>
where T: Sync + PartialEq<U> + ?Sized, U: Sync + ?Sized,

Source§

fn eq(&self, other: &SyncView<U>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, U> PartialOrd<SyncView<U>> for SyncView<T>
where T: Sync + PartialOrd<U> + ?Sized, U: Sync + ?Sized,

Source§

fn partial_cmp(&self, other: &SyncView<U>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T> Copy for SyncView<T>
where T: Sync + Copy,

Source§

impl<T> Eq for SyncView<T>
where T: Sync + Eq + ?Sized,

Source§

impl<T> StructuralPartialEq for SyncView<T>

Source§

impl<T> Sync for SyncView<T>
where T: ?Sized,

Auto Trait Implementations§

§

impl<T> Freeze for SyncView<T>
where T: Freeze + ?Sized,

§

impl<T> RefUnwindSafe for SyncView<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Send for SyncView<T>
where T: Send + ?Sized,

§

impl<T> Unpin for SyncView<T>
where T: Unpin + ?Sized,

§

impl<T> UnsafeUnpin for SyncView<T>
where T: UnsafeUnpin + ?Sized,

§

impl<T> UnwindSafe for SyncView<T>
where T: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<F, V> AddAnyAttr for F
where F: ReactiveFunction<Output = V>, V: RenderHtml + 'static,

Source§

type Output<SomeNewAttr: Attribute> = Box<dyn FnMut() -> <V as AddAnyAttr>::Output<<SomeNewAttr as Attribute>::CloneableOwned> + Send>

The new type once the attribute has been added.
Source§

fn add_any_attr<NewAttr>( self, attr: NewAttr, ) -> <F as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute, <F as AddAnyAttr>::Output<NewAttr>: RenderHtml,

Adds an attribute to the view.
Source§

impl<F> AllowFutureExt for F
where F: Future,

Source§

fn allow<W>(self) -> AllowFuture<Self>
where W: Warning + ?Sized, Self: Sized,

Allow a lint while a future is running
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<F, V> AttributeValue for F
where F: ReactiveFunction<Output = V>, V: AttributeValue + 'static, <V as AttributeValue>::State: 'static,

Source§

type AsyncOutput = <V as AttributeValue>::AsyncOutput

The type once all async data have loaded.
Source§

type State = RenderEffect<<V as AttributeValue>::State>

The state that should be retained between building and rebuilding.
Source§

type Cloneable = Arc<Mutex<dyn FnMut() -> V + Send>>

A version of the value that can be cloned. This can be the same type, or a reference-counted type. Generally speaking, this does not need to refer to the same data, but should behave in the same way. So for example, making an event handler cloneable should probably make it reference-counted (so that a FnMut() continues mutating the same closure), but making a String cloneable does not necessarily need to make it an Arc<str>, as two different clones of a String will still have the same value.
Source§

type CloneableOwned = Arc<Mutex<dyn FnMut() -> V + Send>>

A cloneable type that is also 'static. This is used for spreading across types when the spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned cloneable type has worse performance than the cloneable type, so they are separate.
Source§

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
Source§

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
Source§

fn to_template(_key: &str, _buf: &mut String)

Renders the attribute value to HTML for a <template>.
Source§

fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <F as AttributeValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
Source§

fn build(self, el: &Element, key: &str) -> <F as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
Source§

fn rebuild(self, key: &str, state: &mut <F as AttributeValue>::State)

Applies a new value for the attribute.
Source§

fn into_cloneable(self) -> <F as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
Source§

fn into_cloneable_owned(self) -> <F as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
Source§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Source§

async fn resolve(self) -> <F as AttributeValue>::AsyncOutput

“Resolves” this into a form that is not waiting for any asynchronous data.
Source§

impl<V, Key, Sig, T> BindAttribute<Key, Sig, T> for V
where V: AddAnyAttr, Key: AttributeKey, Sig: IntoSplitSignal<Value = T>, T: FromEventTarget + AttributeValue + PartialEq + Sync + 'static, Signal<BoolOrT<T>>: IntoProperty, <Sig as IntoSplitSignal>::Read: Get<Value = T> + Send + Sync + Clone + 'static, <Sig as IntoSplitSignal>::Write: Send + Clone + 'static, Element: GetValue<T>,

Source§

type Output = <V as AddAnyAttr>::Output<Bind<Key, T, <Sig as IntoSplitSignal>::Read, <Sig as IntoSplitSignal>::Write>>

The type of the element with the two-way binding added.
Source§

fn bind( self, key: Key, signal: Sig, ) -> <V as BindAttribute<Key, Sig, T>>::Output

Adds a two-way binding to the element, which adds an attribute and an event listener to the element when the element is created or hydrated. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<F> Callback for F

Source§

fn on_request( self, request: &Request<()>, response: Response<()>, ) -> Result<Response<()>, Response<Option<String>>>

Called whenever the server read the request from the client and is ready to reply to it. May return additional reply headers. Returning an error resulting in rejecting the incoming connection.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<F> ComponentFunction<(), EmptyMarker> for F
where F: Fn() -> Result<VNode, RenderError> + Clone + 'static,

Source§

fn rebuild(&self, props: ()) -> Result<VNode, RenderError>

Convert the component to a function that takes props and returns an element.
Source§

fn fn_ptr(&self) -> usize

Get the raw address of the component render function.
Source§

impl<F, P> ComponentFunction<P> for F
where F: Fn(P) -> Result<VNode, RenderError> + Clone + 'static,

Source§

fn rebuild(&self, props: P) -> Result<VNode, RenderError>

Convert the component to a function that takes props and returns an element.
Source§

fn fn_ptr(&self) -> usize

Get the raw address of the component render function.
Source§

impl<C, F> ContainsToken<C> for F
where F: Fn(C) -> bool,

Source§

fn contains_token(&self, token: C) -> bool

Returns true if self contains the token
Source§

impl<T, K, V> CustomAttribute<K, V> for T

Source§

fn attr(self, key: K, value: V) -> Self::Output<CustomAttr<K, V>>

Adds an HTML attribute by key and value.
Source§

impl<V, T, P, D> DirectiveAttribute<T, P, D> for V
where V: AddAnyAttr, D: IntoDirective<T, P>, P: Clone + 'static, T: 'static,

Source§

type Output = <V as AddAnyAttr>::Output<Directive<T, D, P>>

The type of the element with the directive added.
Source§

fn directive( self, handler: D, param: P, ) -> <V as DirectiveAttribute<T, P, D>>::Output

Adds a directive to the element, which runs some custom logic in the browser when the element is created or hydrated.
Source§

impl<Func> EffectFunction<(), NoParam> for Func
where Func: FnMut(),

Source§

fn run(&mut self, _: Option<()>)

Call this to execute the function. In case the actual function has no parameters the parameter p will simply be ignored.
Source§

impl<Func, T> EffectFunction<T, SingleParam> for Func
where Func: FnMut(Option<T>) -> T,

Source§

fn run(&mut self, p: Option<T>) -> T

Call this to execute the function. In case the actual function has no parameters the parameter p will simply be ignored.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<F> ErrorSink for F
where F: FnMut(ParseError),

Source§

fn report_error(&mut self, error: ParseError)

Source§

impl<F, E> EventCallback<E> for F
where F: FnMut(E) + 'static,

Source§

fn invoke(&mut self, event: E)

Runs the event handler.
Source§

fn into_shared(self) -> Rc<RefCell<dyn FnMut(E)>>

Converts this into a cloneable/shared event handler.
Source§

impl<F> EventReceiver for F
where F: FnMut(Event),

Source§

fn std_table_open(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn std_table_close(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn array_table_open(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn array_table_close(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn inline_table_open(&mut self, span: Span, _error: &mut dyn ErrorSink) -> bool

Returns if entering the inline table is allowed
Source§

fn inline_table_close(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn array_open(&mut self, span: Span, _error: &mut dyn ErrorSink) -> bool

Returns if entering the array is allowed
Source§

fn array_close(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn simple_key( &mut self, span: Span, encoding: Option<Encoding>, _error: &mut dyn ErrorSink, )

Source§

fn key_sep(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn key_val_sep(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn scalar( &mut self, span: Span, encoding: Option<Encoding>, _error: &mut dyn ErrorSink, )

Source§

fn value_sep(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn whitespace(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn comment(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn newline(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

fn error(&mut self, span: Span, _error: &mut dyn ErrorSink)

Source§

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<E, T, Request> FromReq<MultipartFormData, Request, E> for T
where Request: Req<E> + Send + 'static, T: From<MultipartData>, E: FromServerFnError + Send + Sync,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request> FromReq<Streaming, Request, E> for T
where Request: Req<E> + Send + 'static, T: From<ByteStream<E>> + 'static, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request> FromReq<StreamingText, Request, E> for T
where Request: Req<E> + Send + 'static, T: From<TextStream<E>> + 'static, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<S, T> FromStream<T> for S
where S: From<ArcReadSignal<Option<T>>> + Send + Sync, T: Send + Sync + 'static,

Source§

fn from_stream(stream: impl Stream<Item = T> + Send + 'static) -> S

Creates a signal that contains the latest value of the stream.
Source§

fn from_stream_unsync(stream: impl Stream<Item = T> + 'static) -> S

Creates a signal that contains the latest value of the stream.
Source§

impl<T> FutureExt for T
where T: Future + ?Sized,

Source§

fn map<U, F>(self, f: F) -> Map<Self, F>
where F: FnOnce(Self::Output) -> U, Self: Sized,

Map this future’s output to a different type, returning a new future of the resulting type. Read more
Source§

fn map_into<U>(self) -> MapInto<Self, U>
where Self::Output: Into<U>, Self: Sized,

Map this future’s output to a different type, returning a new future of the resulting type. Read more
Source§

fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
where F: FnOnce(Self::Output) -> Fut, Fut: Future, Self: Sized,

Chain on a computation for when a future finished, passing the result of the future to the provided closure f. Read more
Source§

fn left_future<B>(self) -> Either<Self, B>
where B: Future<Output = Self::Output>, Self: Sized,

Wrap this future in an Either future, making it the left-hand variant of that Either. Read more
Source§

fn right_future<A>(self) -> Either<A, Self>
where A: Future<Output = Self::Output>, Self: Sized,

Wrap this future in an Either future, making it the right-hand variant of that Either. Read more
Source§

fn into_stream(self) -> IntoStream<Self>
where Self: Sized,

Convert this future into a single element stream. Read more
Source§

fn flatten(self) -> Flatten<Self>
where Self::Output: Future, Self: Sized,

Flatten the execution of this future when the output of this future is itself another future. Read more
Source§

fn flatten_stream(self) -> FlattenStream<Self>
where Self::Output: Stream, Self: Sized,

Flatten the execution of this future when the successful result of this future is a stream. Read more
Source§

fn fuse(self) -> Fuse<Self>
where Self: Sized,

Fuse a future such that poll will never again be called once it has completed. This method can be used to turn any Future into a FusedFuture. Read more
Source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where F: FnOnce(&Self::Output), Self: Sized,

Do something with the output of a future before passing it on. Read more
Source§

fn catch_unwind(self) -> CatchUnwind<Self>
where Self: Sized + UnwindSafe,

Catches unwinding panics while polling the future. Read more
Source§

fn shared(self) -> Shared<Self>
where Self: Sized, Self::Output: Clone,

Create a cloneable handle to this future where all handles will resolve to the same result. Read more
Source§

fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)
where Self: Sized,

Turn this future into a future that yields () on completion and sends its output to another future on a separate task. Read more
Source§

fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
where Self: Sized + Send + 'a,

Wrap the future in a Box, pinning it. Read more
Source§

fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>
where Self: Sized + 'a,

Wrap the future in a Box, pinning it. Read more
Source§

fn unit_error(self) -> UnitError<Self>
where Self: Sized,

Source§

fn never_error(self) -> NeverError<Self>
where Self: Sized,

Source§

fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output>
where Self: Unpin,

A convenience for calling Future::poll on Unpin future types.
Source§

fn now_or_never(self) -> Option<Self::Output>
where Self: Sized,

Evaluates and consumes the future, returning the resulting output if the future is ready after the first call to Future::poll. Read more
Source§

impl<T> InitializeFromFunction<T> for T

Source§

fn initialize_from_function(f: fn() -> T) -> T

Create an instance of this type from an initialization function
Source§

impl<F, V> InnerHtmlValue for F
where F: ReactiveFunction<Output = V>, V: InnerHtmlValue + 'static, <V as InnerHtmlValue>::State: 'static,

Source§

type AsyncOutput = <V as InnerHtmlValue>::AsyncOutput

The type after all async data have resolved.
Source§

type State = RenderEffect<<V as InnerHtmlValue>::State>

The view state retained between building and rebuilding.
Source§

type Cloneable = Arc<Mutex<dyn FnMut() -> V + Send>>

An equivalent value that can be cloned.
Source§

type CloneableOwned = Arc<Mutex<dyn FnMut() -> V + Send>>

An equivalent value that can be cloned and is 'static.
Source§

fn html_len(&self) -> usize

The estimated length of the HTML.
Source§

fn to_html(self, buf: &mut String)

Renders the class to HTML.
Source§

fn to_template(_buf: &mut String)

Renders the class to HTML for a <template>.
Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <F as InnerHtmlValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
Source§

fn build(self, el: &Element) -> <F as InnerHtmlValue>::State

Adds this class to the element during client-side rendering.
Source§

fn rebuild(self, state: &mut <F as InnerHtmlValue>::State)

Updates the value.
Source§

fn into_cloneable(self) -> <F as InnerHtmlValue>::Cloneable

Converts this to a cloneable type.
Source§

fn into_cloneable_owned(self) -> <F as InnerHtmlValue>::CloneableOwned

Converts this to a cloneable, owned type.
Source§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Source§

async fn resolve(self) -> <F as InnerHtmlValue>::AsyncOutput

“Resolves” this into a type that is not waiting for any asynchronous data.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoAny for T
where T: Send + RenderHtml,

Source§

fn into_any(self) -> AnyView

Converts the view into a type-erased AnyView.
Source§

impl<T> IntoAttributeValue for T
where T: AttributeValue,

Source§

type Output = T

The attribute value into which this type can be converted.
Source§

fn into_attribute_value(self) -> <T as IntoAttributeValue>::Output

Consumes this value, transforming it into an attribute value.
Source§

impl<F, C> IntoClass for F
where F: ReactiveFunction<Output = C>, C: IntoClass + 'static, <C as IntoClass>::State: 'static,

Source§

type AsyncOutput = <C as IntoClass>::AsyncOutput

The type after all async data have resolved.
Source§

type State = RenderEffect<<C as IntoClass>::State>

The view state retained between building and rebuilding.
Source§

type Cloneable = Arc<Mutex<dyn FnMut() -> C + Send>>

An equivalent value that can be cloned.
Source§

type CloneableOwned = Arc<Mutex<dyn FnMut() -> C + Send>>

An equivalent value that can be cloned and is 'static.
Source§

fn html_len(&self) -> usize

The estimated length of the HTML.
Source§

fn to_html(self, class: &mut String)

Renders the class to HTML.
Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <F as IntoClass>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
Source§

fn build(self, el: &Element) -> <F as IntoClass>::State

Adds this class to the element during client-side rendering.
Source§

fn rebuild(self, state: &mut <F as IntoClass>::State)

Updates the value.
Source§

fn into_cloneable(self) -> <F as IntoClass>::Cloneable

Converts this to a cloneable type.
Source§

fn into_cloneable_owned(self) -> <F as IntoClass>::CloneableOwned

Converts this to a cloneable, owned type.
Source§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Source§

async fn resolve(self) -> <F as IntoClass>::AsyncOutput

“Resolves” this into a type that is not waiting for any asynchronous data.
Source§

fn reset(state: &mut <F as IntoClass>::State)

Reset the class list to the state before this class was added.
Source§

const TEMPLATE: &'static str = ""

The HTML that should be included in a <template>.
Source§

const MIN_LENGTH: usize = _

The minimum length of the HTML.
Source§

fn should_overwrite(&self) -> bool

Whether this class attribute should overwrite previous class values. Returns true for class="..." attributes, false for class:name=value directives.
Source§

fn to_template(class: &mut String)

Renders the class to HTML for a <template>.
Source§

impl<F> IntoDirective<(Element,), ()> for F
where F: Fn(Element) + 'static,

Source§

type Cloneable = Arc<dyn Fn(Element)>

An equivalent to this directive that is cloneable and owned.
Source§

fn run(&self, el: Element, _: ())

Calls the handler function
Source§

fn into_cloneable(self) -> <F as IntoDirective<(Element,), ()>>::Cloneable

Converts this into a cloneable type.
Source§

impl<F, P> IntoDirective<(Element, P), P> for F
where F: Fn(Element, P) + 'static, P: 'static,

Source§

type Cloneable = Arc<dyn Fn(Element, P)>

An equivalent to this directive that is cloneable and owned.
Source§

fn run(&self, el: Element, param: P)

Calls the handler function
Source§

fn into_cloneable(self) -> <F as IntoDirective<(Element, P), P>>::Cloneable

Converts this into a cloneable type.
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<F> IntoFuture for F
where F: Future,

Source§

type Output = <F as Future>::Output

The output that the future will produce on completion.
Source§

type IntoFuture = F

Which kind of future are we turning this into?
Source§

fn into_future(self) -> <F as IntoFuture>::IntoFuture

Creates a future from a value. Read more
Source§

impl<T> IntoMaybeErased for T
where T: RenderHtml,

Source§

type Output = T

The type of the output.
Source§

fn into_maybe_erased(self) -> <T as IntoMaybeErased>::Output

Converts the view into a type-erased view if in erased mode.
Source§

impl<T, F> IntoOptionGetter<T, FunctionMarker> for F
where F: Fn() -> Option<T> + Send + Sync + 'static,

Source§

fn into_option_getter(self) -> OptionGetter<T>

Converts the given value into an OptionGetter.
Source§

impl<F, V> IntoProperty for F
where F: ReactiveFunction<Output = V>, V: IntoProperty + 'static, <V as IntoProperty>::State: 'static,

Source§

type State = RenderEffect<<V as IntoProperty>::State>

The view state retained between building and rebuilding.
Source§

type Cloneable = Arc<Mutex<dyn FnMut() -> V + Send>>

An equivalent value that can be cloned.
Source§

type CloneableOwned = Arc<Mutex<dyn FnMut() -> V + Send>>

An equivalent value that can be cloned and is 'static.
Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, key: &str, ) -> <F as IntoProperty>::State

Adds the property on an element created from HTML.
Source§

fn build(self, el: &Element, key: &str) -> <F as IntoProperty>::State

Adds the property during client-side rendering.
Source§

fn rebuild(self, state: &mut <F as IntoProperty>::State, key: &str)

Updates the property with a new value.
Source§

fn into_cloneable(self) -> <F as IntoProperty>::Cloneable

Converts this to a cloneable type.
Source§

fn into_cloneable_owned(self) -> <F as IntoProperty>::CloneableOwned

Converts this to a cloneable, owned type.
Source§

impl<I, O, F> IntoReactiveValue<Callback<I, O>, __IntoReactiveValueMarkerCallbackSingleParam> for F
where F: Fn(I) -> O + Send + Sync + 'static,

Source§

fn into_reactive_value(self) -> Callback<I, O>

Converts self into a T.
Source§

impl<I, F> IntoReactiveValue<Callback<I, String>, __IntoReactiveValueMarkerCallbackStrOutputToString> for F
where F: Fn(I) -> &'static str + Send + Sync + 'static,

Source§

fn into_reactive_value(self) -> Callback<I, String>

Converts self into a T.
Source§

impl<T, I> IntoReactiveValue<T, __IntoReactiveValueMarkerBaseCase> for I
where I: Into<T>,

Source§

fn into_reactive_value(self) -> T

Converts self into a T.
Source§

impl<I, O, F> IntoReactiveValue<UnsyncCallback<I, O>, __IntoReactiveValueMarkerCallbackSingleParam> for F
where F: Fn(I) -> O + 'static,

Source§

fn into_reactive_value(self) -> UnsyncCallback<I, O>

Converts self into a T.
Source§

impl<I, F> IntoReactiveValue<UnsyncCallback<I, String>, __IntoReactiveValueMarkerCallbackStrOutputToString> for F
where F: Fn(I) -> &'static str + 'static,

Source§

fn into_reactive_value(self) -> UnsyncCallback<I, String>

Converts self into a T.
Source§

impl<T> IntoRender for T
where T: Render,

Source§

type Output = T

The renderable type into which this type can be converted.
Source§

fn into_render(self) -> <T as IntoRender>::Output

Consumes this value, transforming it into the renderable type.
Source§

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, Response, Encoding, T> IntoRes<Patch<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Post<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Put<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<F, T, S> IntoSignalSetter<T, S> for F
where F: Fn(T) + 'static + Send + Sync, S: Storage<Box<dyn Fn(T) + Send + Sync>>,

Source§

fn into_signal_setter(self) -> SignalSetter<T, S>

Consumes self, returning SignalSetter<T>.
Source§

impl<F, C> IntoStyle for F
where F: ReactiveFunction<Output = C>, C: IntoStyle + 'static, <C as IntoStyle>::State: 'static,

Source§

type AsyncOutput = <C as IntoStyle>::AsyncOutput

The type after all async data have resolved.
Source§

type State = RenderEffect<<C as IntoStyle>::State>

The view state retained between building and rebuilding.
Source§

type Cloneable = Arc<Mutex<dyn FnMut() -> C + Send>>

An equivalent value that can be cloned.
Source§

type CloneableOwned = Arc<Mutex<dyn FnMut() -> C + Send>>

An equivalent value that can be cloned and is 'static.
Source§

fn to_html(self, style: &mut String)

Renders the style to HTML.
Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <F as IntoStyle>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
Source§

fn build(self, el: &Element) -> <F as IntoStyle>::State

Adds this style to the element during client-side rendering.
Source§

fn rebuild(self, state: &mut <F as IntoStyle>::State)

Updates the value.
Source§

fn into_cloneable(self) -> <F as IntoStyle>::Cloneable

Converts this to a cloneable type.
Source§

fn into_cloneable_owned(self) -> <F as IntoStyle>::CloneableOwned

Converts this to a cloneable, owned type.
Source§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Source§

async fn resolve(self) -> <F as IntoStyle>::AsyncOutput

“Resolves” this into a type that is not waiting for any asynchronous data.
Source§

fn reset(state: &mut <F as IntoStyle>::State)

Reset the styling to the state before this style was added.
Source§

impl<F, S> IntoStyleValue for F
where F: ReactiveFunction<Output = S>, S: IntoStyleValue + 'static,

Source§

type AsyncOutput = F

The type after all async data have resolved.
Source§

type State = (Arc<str>, RenderEffect<<S as IntoStyleValue>::State>)

The view state retained between building and rebuilding.
Source§

type Cloneable = Arc<Mutex<dyn FnMut() -> S + Send>>

An equivalent value that can be cloned.
Source§

type CloneableOwned = Arc<Mutex<dyn FnMut() -> S + Send>>

An equivalent value that can be cloned and is 'static.
Source§

fn to_html(self, name: &str, style: &mut String)

Renders the style to HTML.
Source§

fn build( self, style: &CssStyleDeclaration, name: &str, ) -> <F as IntoStyleValue>::State

Adds this style to the element during client-side rendering.
Source§

fn rebuild( self, style: &CssStyleDeclaration, name: &str, state: &mut <F as IntoStyleValue>::State, )

Updates the value.
Source§

fn hydrate( self, style: &CssStyleDeclaration, name: &str, ) -> <F as IntoStyleValue>::State

Adds interactivity as necessary, given DOM nodes that were created from HTML that has either been rendered on the server, or cloned for a <template>.
Source§

fn into_cloneable(self) -> <F as IntoStyleValue>::Cloneable

Converts this to a cloneable type.
Source§

fn into_cloneable_owned(self) -> <F as IntoStyleValue>::CloneableOwned

Converts this to a cloneable, owned type.
Source§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Source§

async fn resolve(self) -> <F as IntoStyleValue>::AsyncOutput

“Resolves” this into a type that is not waiting for any asynchronous data.
Source§

impl<T> IntoView for T
where T: Render + RenderHtml + Send,

Source§

fn into_view(self) -> View<T>

Wraps the inner type.
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<I, O, E, F> Parser<I, O, E> for F
where F: FnMut(&mut I) -> Result<O, E>, I: Stream,

Source§

fn parse_next(&mut self, i: &mut I) -> Result<O, E>

Take tokens from the Stream, turning it into the output Read more
Source§

fn parse( &mut self, input: I, ) -> Result<O, ParseError<I, <E as ParserError<I>>::Inner>>
where Self: Sized, I: Stream + StreamIsPartial, E: ParserError<I>, <E as ParserError<I>>::Inner: ParserError<I>,

Parse all of input, generating O from it Read more
Source§

fn parse_peek(&mut self, input: I) -> Result<(I, O), E>

Take tokens from the Stream, turning it into the output Read more
Source§

fn by_ref(&mut self) -> ByRef<'_, Self, I, O, E>
where Self: Sized,

Treat &mut Self as a parser Read more
Source§

fn value<O2>(self, val: O2) -> Value<Self, I, O, O2, E>
where Self: Sized, O2: Clone,

Produce the provided value Read more
Source§

fn default_value<O2>(self) -> DefaultValue<Self, I, O, O2, E>
where Self: Sized, O2: Default,

Produce a type’s default value Read more
Source§

fn void(self) -> Void<Self, I, O, E>
where Self: Sized,

Discards the output of the Parser Read more
Source§

fn output_into<O2>(self) -> OutputInto<Self, I, O, O2, E>
where Self: Sized, O: Into<O2>,

Convert the parser’s output to another type using std::convert::From Read more
Source§

fn take(self) -> Take<Self, I, O, E>
where Self: Sized, I: Stream,

Produce the consumed input as produced value. Read more
Source§

fn with_taken(self) -> WithTaken<Self, I, O, E>
where Self: Sized, I: Stream,

Produce the consumed input with the output Read more
Source§

fn span(self) -> Span<Self, I, O, E>
where Self: Sized, I: Stream + Location,

Produce the location of the consumed input as produced value. Read more
Source§

fn with_span(self) -> WithSpan<Self, I, O, E>
where Self: Sized, I: Stream + Location,

Produce the location of consumed input with the output Read more
Source§

fn map<G, O2>(self, map: G) -> Map<Self, G, I, O, O2, E>
where G: FnMut(O) -> O2, Self: Sized,

Maps a function over the output of a parser Read more
Source§

fn try_map<G, O2, E2>(self, map: G) -> TryMap<Self, G, I, O, O2, E, E2>
where Self: Sized, G: FnMut(O) -> Result<O2, E2>, I: Stream, E: FromExternalError<I, E2> + ParserError<I>,

Applies a function returning a Result over the output of a parser. Read more
Source§

fn verify_map<G, O2>(self, map: G) -> VerifyMap<Self, G, I, O, O2, E>
where Self: Sized, G: FnMut(O) -> Option<O2>, I: Stream, E: ParserError<I>,

Source§

fn flat_map<G, H, O2>(self, map: G) -> FlatMap<Self, G, H, I, O, O2, E>
where Self: Sized, G: FnMut(O) -> H, H: Parser<I, O2, E>,

Creates a parser from the output of this one Read more
Source§

fn and_then<G, O2>(self, inner: G) -> AndThen<Self, G, I, O, O2, E>
where Self: Sized, G: Parser<O, O2, E>, O: StreamIsPartial, I: Stream,

Applies a second parser over the output of the first one Read more
Source§

fn parse_to<O2>(self) -> ParseTo<Self, I, O, O2, E>
where Self: Sized, I: Stream, O: ParseSlice<O2>, E: ParserError<I>,

Apply std::str::FromStr to the output of the parser Read more
Source§

fn verify<G, O2>(self, filter: G) -> Verify<Self, G, I, O, O2, E>
where Self: Sized, G: FnMut(&O2) -> bool, I: Stream, O: Borrow<O2>, E: ParserError<I>, O2: ?Sized,

Returns the output of the child parser if it satisfies a verification function. Read more
Source§

fn context<C>(self, context: C) -> Context<Self, I, O, E, C>
where Self: Sized, I: Stream, E: AddContext<I, C> + ParserError<I>, C: Clone + Debug,

If parsing fails, add context to the error Read more
Source§

fn context_with<F, C, FI>( self, context: F, ) -> ContextWith<Self, I, O, E, F, C, FI>
where Self: Sized, I: Stream, E: AddContext<I, C> + ParserError<I>, F: Fn() -> FI + Clone, C: Debug, FI: Iterator<Item = C>,

If parsing fails, dynamically add context to the error Read more
Source§

fn map_err<G, E2>(self, map: G) -> MapErr<Self, G, I, O, E, E2>
where G: FnMut(E) -> E2, Self: Sized,

Maps a function over the error of a parser Read more
Source§

fn complete_err(self) -> CompleteErr<Self, I, O, E>
where Self: Sized,

Source§

fn err_into<E2>(self) -> ErrInto<Self, I, O, E, E2>
where Self: Sized, E: Into<E2>,

Convert the parser’s error to another type using std::convert::From
Source§

impl<F, T> Parser for F
where F: FnOnce(&ParseBuffer<'_>) -> Result<T, Error>,

Source§

type Output = T

Source§

fn parse2(self, tokens: TokenStream) -> Result<T, Error>

Parse a proc-macro2 token stream into the chosen syntax tree node. Read more
Source§

fn __parse_scoped( self, scope: Span, tokens: TokenStream, ) -> Result<<F as Parser>::Output, Error>

Source§

fn parse(self, tokens: TokenStream) -> Result<Self::Output, Error>

Parse tokens of source code into the chosen syntax tree node. Read more
Source§

fn parse_str(self, s: &str) -> Result<Self::Output, Error>

Parse a string of Rust code into the chosen syntax tree node. Read more
Source§

impl<F> Pattern for F
where F: FnMut(char) -> bool,

Source§

type Searcher<'a> = CharPredicateSearcher<'a, F>

🔬This is a nightly-only experimental API. (pattern)
Associated searcher for this pattern
Source§

fn into_searcher<'a>(self, haystack: &'a str) -> CharPredicateSearcher<'a, F>

🔬This is a nightly-only experimental API. (pattern)
Constructs the associated searcher from self and the haystack to search in.
Source§

fn is_contained_in<'a>(self, haystack: &'a str) -> bool

🔬This is a nightly-only experimental API. (pattern)
Checks whether the pattern matches anywhere in the haystack
Source§

fn is_prefix_of<'a>(self, haystack: &'a str) -> bool

🔬This is a nightly-only experimental API. (pattern)
Checks whether the pattern matches at the front of the haystack
Source§

fn strip_prefix_of<'a>(self, haystack: &'a str) -> Option<&'a str>

🔬This is a nightly-only experimental API. (pattern)
Removes the pattern from the front of haystack, if it matches.
Source§

fn is_suffix_of<'a>(self, haystack: &'a str) -> bool

🔬This is a nightly-only experimental API. (pattern)
Checks whether the pattern matches at the back of the haystack
Source§

fn strip_suffix_of<'a>(self, haystack: &'a str) -> Option<&'a str>

🔬This is a nightly-only experimental API. (pattern)
Removes the pattern from the back of haystack, if it matches.
Source§

fn as_utf8_pattern(&self) -> Option<Utf8Pattern<'_>>

🔬This is a nightly-only experimental API. (pattern)
Returns the pattern as utf-8 bytes if possible.
Source§

impl<F, T> Peek for F
where F: Copy + FnOnce(TokenMarker) -> T, T: Token,

Source§

type Token = T

Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<F, T> ReactiveFunction for F
where F: FnMut() -> T + Send + 'static,

Source§

type Output = T

The return type of the function.
Source§

fn invoke(&mut self) -> <F as ReactiveFunction>::Output

Call the function.
Source§

fn into_shared( self, ) -> Arc<Mutex<dyn FnMut() -> <F as ReactiveFunction>::Output + Send>>

Converts the function into a cloneable, shared type.
Source§

impl<F, V> Render for F
where F: ReactiveFunction<Output = V>, V: Render, <V as Render>::State: 'static,

Source§

type State = RenderEffectState<<V as Render>::State>

The “view state” for this type, which can be retained between updates. Read more
Source§

fn build(self) -> <F as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
Source§

fn rebuild(self, state: &mut <F as Render>::State)

Updates the view with new data.
Source§

impl<F, V> RenderHtml for F
where F: ReactiveFunction<Output = V>, V: RenderHtml + 'static, <V as Render>::State: 'static,

Source§

const MIN_LENGTH: usize = 0

The minimum length of HTML created when this view is rendered.
Source§

type AsyncOutput = <V as RenderHtml>::AsyncOutput

The type of the view after waiting for all asynchronous data to load.
Source§

type Owned = F

An equivalent value that is 'static.
Source§

fn dry_resolve(&mut self)

“Runs” the view without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Source§

async fn resolve(self) -> <F as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
Source§

fn html_len(&self) -> usize

An estimated length for this view, when rendered to HTML. Read more
Source§

fn to_html_with_buf( self, buf: &mut String, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )

Renders a view to HTML, writing it into the given buffer.
Source§

fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )

Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
Source§

fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <F as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
Source§

async fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> <F as Render>::State

Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
Source§

fn into_owned(self) -> <F as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
Source§

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
Source§

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
Source§

fn to_html_branching(self) -> String
where Self: Sized,

Renders a view to HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
Source§

fn to_html_stream_in_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
Source§

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
Source§

fn to_html_stream_out_of_order(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
Source§

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff HTML pages against one another, by marking sections of the view that branch to different types with marker comments.
Source§

fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element.
Source§

fn hydrate_from_position<const FROM_SERVER: bool>( self, el: &Element, position: Position, ) -> Self::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
Source§

impl<F, T> Replacer for F
where F: FnMut(&Captures<'_>) -> T, T: AsRef<[u8]>,

Source§

fn replace_append(&mut self, caps: &Captures<'_>, dst: &mut Vec<u8>)

Appends possibly empty data to dst to replace the current match. Read more
Source§

fn no_expansion<'r>(&'r mut self) -> Option<Cow<'r, [u8]>>

Return a fixed unchanging replacement byte string. Read more
Source§

fn by_ref<'r>(&'r mut self) -> ReplacerRef<'r, Self>

Returns a type that implements Replacer, but that borrows and wraps this Replacer. Read more
Source§

impl<F, T> Replacer for F
where F: FnMut(&Captures<'_>) -> T, T: AsRef<str>,

Source§

fn replace_append(&mut self, caps: &Captures<'_>, dst: &mut String)

Appends possibly empty data to dst to replace the current match. Read more
Source§

fn no_expansion<'r>(&'r mut self) -> Option<Cow<'r, str>>

Return a fixed unchanging replacement string. Read more
Source§

fn by_ref<'r>(&'r mut self) -> ReplacerRef<'r, Self>

Returns a type that implements Replacer, but that borrows and wraps this Replacer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SerializableKey for T

Source§

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
Source§

impl<Ret> SpawnIfAsync<(), Ret> for Ret

Source§

fn spawn(self) -> Ret

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<F> SpawnIfAsync<AsyncMarker> for F
where F: Future<Output = ()> + 'static,

Source§

fn spawn(self)

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<T> SpawnIfAsync<AsyncResultMarker> for T
where T: Future<Output = Result<(), CapturedError>> + 'static,

Source§

fn spawn(self)

Spawn the value into the dioxus runtime if it is an async block
Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

Source§

fn super_from(input: T) -> O

Convert from a type to another type.
Source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

Source§

fn super_into(self) -> O

Convert from a type to another type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<F, V> ToTemplate for F
where F: ReactiveFunction<Output = V>, V: ToTemplate,

Source§

const TEMPLATE: &'static str = V::TEMPLATE

The HTML content of the static template.
Source§

fn to_template( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template. This does not take actual view data, but can be used for constructing part of an HTML <template> that corresponds to a view of a particular type.
Source§

const CLASS: &'static str = ""

The class attribute content known at compile time.
Source§

const STYLE: &'static str = ""

The style attribute content known at compile time.
Source§

const LEN: usize = _

The length of the template.
Source§

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<F, T, E> TryFuture for F
where F: Future<Output = Result<T, E>> + ?Sized,

Source§

type Ok = T

The type of successful values yielded by this future
Source§

type Error = E

The type of failures yielded by this future
Source§

fn try_poll( self: Pin<&mut F>, cx: &mut Context<'_>, ) -> Poll<<F as Future>::Output>

Poll this TryFuture as if it were a Future. Read more
Source§

impl<Fut> TryFutureExt for Fut
where Fut: TryFuture + ?Sized,

Source§

fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>
where Self::Ok: Sink<Item, Error = Self::Error>, Self: Sized,

Flattens the execution of this future when the successful result of this future is a Sink. Read more
Source§

fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
where F: FnOnce(Self::Ok) -> T, Self: Sized,

Maps this future’s success value to a different value. Read more
Source§

fn map_ok_or_else<T, E, F>(self, e: E, f: F) -> MapOkOrElse<Self, F, E>
where F: FnOnce(Self::Ok) -> T, E: FnOnce(Self::Error) -> T, Self: Sized,

Maps this future’s success value to a different value, and permits for error handling resulting in the same type. Read more
Source§

fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
where F: FnOnce(Self::Error) -> E, Self: Sized,

Maps this future’s error value to a different value. Read more
Source§

fn err_into<E>(self) -> ErrInto<Self, E>
where Self: Sized, Self::Error: Into<E>,

Maps this future’s Error to a new error type using the Into trait. Read more
Source§

fn ok_into<U>(self) -> OkInto<Self, U>
where Self: Sized, Self::Ok: Into<U>,

Maps this future’s Ok to a new type using the Into trait.
Source§

fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
where F: FnOnce(Self::Ok) -> Fut, Fut: TryFuture<Error = Self::Error>, Self: Sized,

Executes another future after this one resolves successfully. The success value is passed to a closure to create this subsequent future. Read more
Source§

fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F>
where F: FnOnce(Self::Error) -> Fut, Fut: TryFuture<Ok = Self::Ok>, Self: Sized,

Executes another future if this one resolves to an error. The error value is passed to a closure to create this subsequent future. Read more
Source§

fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
where F: FnOnce(&Self::Ok), Self: Sized,

Do something with the success value of a future before passing it on. Read more
Source§

fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
where F: FnOnce(&Self::Error), Self: Sized,

Do something with the error value of a future before passing it on. Read more
Source§

fn try_flatten(self) -> TryFlatten<Self, Self::Ok>
where Self::Ok: TryFuture<Error = Self::Error>, Self: Sized,

Flatten the execution of this future when the successful result of this future is another future. Read more
Source§

fn try_flatten_stream(self) -> TryFlattenStream<Self>
where Self::Ok: TryStream<Error = Self::Error>, Self: Sized,

Flatten the execution of this future when the successful result of this future is a stream. Read more
Source§

fn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F>
where Self: Sized, F: FnOnce(Self::Error) -> Self::Ok,

Unwraps this future’s output, producing a future with this future’s Ok type as its Output type. Read more
Source§

fn into_future(self) -> IntoFuture<Self>
where Self: Sized,

Wraps a TryFuture into a type that implements Future. Read more
Source§

fn try_poll_unpin( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::Ok, Self::Error>>
where Self: Unpin,

A convenience method for calling TryFuture::try_poll on Unpin future types.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<F> Visit for F
where F: FnMut(&Field, &dyn Debug),

Source§

fn record_debug(&mut self, field: &Field, value: &dyn Debug)

Visit a value implementing fmt::Debug.
Source§

fn record_f64(&mut self, field: &Field, value: f64)

Visit a double-precision floating point value.
Source§

fn record_i64(&mut self, field: &Field, value: i64)

Visit a signed 64-bit integer value.
Source§

fn record_u64(&mut self, field: &Field, value: u64)

Visit an unsigned 64-bit integer value.
Source§

fn record_i128(&mut self, field: &Field, value: i128)

Visit a signed 128-bit integer value.
Source§

fn record_u128(&mut self, field: &Field, value: u128)

Visit an unsigned 128-bit integer value.
Source§

fn record_bool(&mut self, field: &Field, value: bool)

Visit a boolean value.
Source§

fn record_str(&mut self, field: &Field, value: &str)

Visit a string value.
Source§

fn record_bytes(&mut self, field: &Field, value: &[u8])

Visit a byte slice.
Source§

fn record_error(&mut self, field: &Field, value: &(dyn Error + 'static))

Records a type implementing Error. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<I, O, E, P> ModalParser<I, O, E> for P
where P: Parser<I, O, ErrMode<E>>,