pub struct Registry { /* private fields */ }Expand description
Endpoint registry, passed to the function exported with export_app!.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn read_only<F>(
&mut self,
path: &str,
method: &str,
auth: Auth,
handler: F,
) -> BridgeResult<()>
pub fn read_only<F>( &mut self, path: &str, method: &str, auth: Auth, handler: F, ) -> BridgeResult<()>
Register a handler with read-only KV access.
path excludes the /app prefix and may contain parameters, such as
/records/{key}. method is an HTTP method, such as "GET". Returns
BridgeError::InvalidArgument if either is empty, or
BridgeError::Internal if CCF rejects the endpoint.
Sourcepub fn read_write<F>(
&mut self,
path: &str,
method: &str,
auth: Auth,
handler: F,
) -> BridgeResult<()>
pub fn read_write<F>( &mut self, path: &str, method: &str, auth: Auth, handler: F, ) -> BridgeResult<()>
Register a handler with read-write KV access.
Arguments and errors are as for read_only.
Auto Trait Implementations§
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl !Send for Registry
impl !Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe for Registry
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