pub struct ModuleBuilder<T> { /* private fields */ }Expand description
Builder pattern for bootstrapping PyWatt modules.
Implementations§
Source§impl<T: Send + 'static> ModuleBuilder<T>
impl<T: Send + 'static> ModuleBuilder<T>
Sourcepub fn secret_keys(self, keys: &[&str]) -> Self
pub fn secret_keys(self, keys: &[&str]) -> Self
Set the secret keys to fetch initially.
Sourcepub fn endpoints(self, endpoints: Vec<AnnouncedEndpoint>) -> Self
pub fn endpoints(self, endpoints: Vec<AnnouncedEndpoint>) -> Self
Set the endpoints for module announcement.
Sourcepub fn state<F>(self, builder: F) -> Self
pub fn state<F>(self, builder: F) -> Self
Set the state builder function, which constructs user state from init and fetched secrets.
Sourcepub async fn build(
self,
) -> Result<(AppState<T>, JoinHandle<()>), BootstrapError>
pub async fn build( self, ) -> Result<(AppState<T>, JoinHandle<()>), BootstrapError>
Execute the bootstrap process: handshake, secret fetch, announcement, and start IPC loop.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ModuleBuilder<T>
impl<T> !RefUnwindSafe for ModuleBuilder<T>
impl<T> Send for ModuleBuilder<T>
impl<T> Sync for ModuleBuilder<T>
impl<T> Unpin for ModuleBuilder<T>
impl<T> !UnwindSafe for ModuleBuilder<T>
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