Struct rpc_router::RpcResourcesBuilder
source · pub struct RpcResourcesBuilder { /* private fields */ }
Implementations§
source§impl RpcResourcesBuilder
impl RpcResourcesBuilder
pub fn get<T: Clone + Send + Sync + 'static>(&self) -> Option<T>
pub fn insert<T: Clone + Send + Sync + 'static>(self, val: T) -> Self
sourcepub fn build(self) -> RpcResources
pub fn build(self) -> RpcResources
Build a new RpcResources
.
Use the build_shared
function.
Build RpcResources
with an Arc
to enable efficient cloning without
duplicating the content (i.e., without cloning the type hashmap).
Note: Use this option if each RPC call uses the same RPC Resources.
If uncertain, opt for this method via .build()
.
sourcepub fn build_owned(self) -> RpcResources
pub fn build_owned(self) -> RpcResources
Build an owned RpcResources
, meaning that cloning it will duplicate the entire type hashmap.
Note: Use this option if each RPC call requires different Rpc Resources.
Trait Implementations§
source§impl Default for RpcResourcesBuilder
impl Default for RpcResourcesBuilder
source§fn default() -> RpcResourcesBuilder
fn default() -> RpcResourcesBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for RpcResourcesBuilder
impl Send for RpcResourcesBuilder
impl Sync for RpcResourcesBuilder
impl Unpin for RpcResourcesBuilder
impl !UnwindSafe for RpcResourcesBuilder
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