pub struct InertiaConfigBuilder<V>where
V: ToString,{
pub url: Option<&'static str>,
pub version: Option<InertiaVersion<V>>,
pub template_resolver: Option<Box<dyn TemplateResolver + Send + Sync>>,
pub with_ssr: bool,
pub custom_ssr_client: Option<SsrClient>,
pub encrypt_history: bool,
}
Fields§
§url: Option<&'static str>
§version: Option<InertiaVersion<V>>
§template_resolver: Option<Box<dyn TemplateResolver + Send + Sync>>
§with_ssr: bool
§custom_ssr_client: Option<SsrClient>
§encrypt_history: bool
Implementations§
Source§impl<V> InertiaConfigBuilder<V>where
V: ToString,
impl<V> InertiaConfigBuilder<V>where
V: ToString,
Sourcepub fn new() -> Self
pub fn new() -> Self
Instatiates a new InertiaConfigBuilder instance. It must be configured using a fluent syntax.
§Examples
use inertia_rust::{InertiaConfigBuilder, InertiaVersion};
let inertia_config = InertiaConfigBuilder::new()
.set_url("http://localhost:8080")
.set_version(InertiaVersion::Literal("v1"))
.set_template_resolver(Box::new(YourTemplateResolver))
.build();
pub fn set_ssr_client(self, ssr_client: SsrClient) -> Self
pub fn set_url(self, url: &'static str) -> Self
pub fn set_version(self, version: InertiaVersion<V>) -> Self
pub fn set_template_resolver( self, template_resolver: Box<dyn TemplateResolver + Send + Sync>, ) -> Self
pub fn enable_ssr(self) -> Self
pub fn encrypt_history(self) -> Self
Sourcepub fn build(self) -> InertiaConfig<V>
pub fn build(self) -> InertiaConfig<V>
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for InertiaConfigBuilder<V>where
V: Freeze,
impl<V> !RefUnwindSafe for InertiaConfigBuilder<V>
impl<V> !Send for InertiaConfigBuilder<V>
impl<V> !Sync for InertiaConfigBuilder<V>
impl<V> Unpin for InertiaConfigBuilder<V>where
V: Unpin,
impl<V> !UnwindSafe for InertiaConfigBuilder<V>
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