Skip to main content

RenderOptions

Struct RenderOptions 

Source
pub struct RenderOptions<'a> {
    pub entry_id: &'a str,
    pub request_path: &'a str,
    pub nonce: Option<&'a str>,
}
Expand description

Options controlling how the handler renders a protocol.

The handler performs server-side route matching: matched routes are rendered visible with content; non-matched routes are rendered hidden and empty.

Fields§

§entry_id: &'a str

The fragment ID to start rendering from (e.g., "index.html").

§request_path: &'a str

The URL path to match routes against (e.g., "/contacts/42").

§nonce: Option<&'a str>

Optional CSP nonce for inline <script> tags. When set, all inline scripts include nonce="VALUE" and a <meta name="webui-nonce"> tag is emitted for the client router.

Implementations§

Source§

impl<'a> RenderOptions<'a>

Source

pub fn new(entry_id: &'a str, request_path: &'a str) -> Self

Create render options for the given entry fragment and request path.

Source

pub fn with_nonce(self, nonce: &'a str) -> Self

Set the CSP nonce for inline scripts.

Auto Trait Implementations§

§

impl<'a> Freeze for RenderOptions<'a>

§

impl<'a> RefUnwindSafe for RenderOptions<'a>

§

impl<'a> Send for RenderOptions<'a>

§

impl<'a> Sync for RenderOptions<'a>

§

impl<'a> Unpin for RenderOptions<'a>

§

impl<'a> UnsafeUnpin for RenderOptions<'a>

§

impl<'a> UnwindSafe for RenderOptions<'a>

Blanket Implementations§

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> 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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<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.