pub struct ProtectedInternalEndpoint { /* private fields */ }Expand description
ProtectedInternalEndpoint
Generated metadata for one protected Canic internal endpoint.
Endpoint macros emit this descriptor next to protected internal endpoints.
Callers should pass it to CanicInternalClient instead of repeating method
names and accepted-role metadata by hand.
Implementations§
Source§impl ProtectedInternalEndpoint
impl ProtectedInternalEndpoint
pub fn new( method: &'static str, roles: impl IntoIterator<Item = CanisterRole>, ) -> Self
pub const fn method(&self) -> &'static str
pub fn accepted_roles(&self) -> &[CanisterRole]
pub fn accepts_role(&self, role: &CanisterRole) -> bool
pub fn single_role(&self) -> Option<&CanisterRole>
pub fn required_single_role(&self) -> Result<CanisterRole, Error>
Trait Implementations§
Source§impl Clone for ProtectedInternalEndpoint
impl Clone for ProtectedInternalEndpoint
Source§fn clone(&self) -> ProtectedInternalEndpoint
fn clone(&self) -> ProtectedInternalEndpoint
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 Freeze for ProtectedInternalEndpoint
impl RefUnwindSafe for ProtectedInternalEndpoint
impl Send for ProtectedInternalEndpoint
impl Sync for ProtectedInternalEndpoint
impl Unpin for ProtectedInternalEndpoint
impl UnsafeUnpin for ProtectedInternalEndpoint
impl UnwindSafe for ProtectedInternalEndpoint
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