pub struct ResourceEntry { /* private fields */ }Expand description
A registered resource — one Arc<dyn Resource>. The router consults it
for the “before-dispatch” surface (auth, permission, realtime) and calls
ResourceMetadata::handle for verb dispatch, all on the shared Arc.
Implementations§
Source§impl ResourceEntry
impl ResourceEntry
Sourcepub fn new<R>(resource: R) -> Selfwhere
R: ResourceMetadata + 'static,
pub fn new<R>(resource: R) -> Selfwhere
R: ResourceMetadata + 'static,
Register a resource from any impl Resource. No Clone, no tower
bounds — just the trait.
Sourcepub fn from_arc(resource: Arc<dyn ResourceMetadata>) -> Self
pub fn from_arc(resource: Arc<dyn ResourceMetadata>) -> Self
Register from an already-boxed resource (e.g. one wrapped by an
adapter such as ExtendedTableResource).
Sourcepub fn metadata(&self) -> &(dyn ResourceMetadata + 'static)
pub fn metadata(&self) -> &(dyn ResourceMetadata + 'static)
Borrow the resource for the auth / permission / realtime pipeline.
Sourcepub fn resource(&self) -> Arc<dyn ResourceMetadata> ⓘ
pub fn resource(&self) -> Arc<dyn ResourceMetadata> ⓘ
The shared resource handle — clone it (one Arc bump) to hold for a
request’s dispatch, then call ResourceMetadata::handle.
Trait Implementations§
Source§impl Clone for ResourceEntry
impl Clone for ResourceEntry
Source§fn clone(&self) -> ResourceEntry
fn clone(&self) -> ResourceEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ResourceEntry
impl !UnwindSafe for ResourceEntry
impl Freeze for ResourceEntry
impl Send for ResourceEntry
impl Sync for ResourceEntry
impl Unpin for ResourceEntry
impl UnsafeUnpin for ResourceEntry
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