pub struct JsPrincipal { /* private fields */ }
Implementations§
Source§impl JsPrincipal
impl JsPrincipal
pub fn system() -> JsPrincipal
pub fn public_key(pk: &JsMPublicKey) -> Result<JsPrincipal, JsValue>
pub fn validate_impersonation(&self, pk: &JsMPublicKey) -> Result<(), JsValue>
Trait Implementations§
Source§impl From<JsPrincipal> for JsValue
impl From<JsPrincipal> for JsValue
Source§fn from(value: JsPrincipal) -> JsValue
fn from(value: JsPrincipal) -> JsValue
Converts to this type from the input type.
Source§impl From<Principal> for JsPrincipal
impl From<Principal> for JsPrincipal
Source§fn from(inner: Principal) -> JsPrincipal
fn from(inner: Principal) -> JsPrincipal
Converts to this type from the input type.
Source§impl FromWasmAbi for JsPrincipal
impl FromWasmAbi for JsPrincipal
Source§impl IntoWasmAbi for JsPrincipal
impl IntoWasmAbi for JsPrincipal
Source§impl LongRefFromWasmAbi for JsPrincipal
impl LongRefFromWasmAbi for JsPrincipal
Source§type Anchor = RcRef<JsPrincipal>
type Anchor = RcRef<JsPrincipal>
Same as
RefFromWasmAbi::Anchor
Source§unsafe fn long_ref_from_abi(
js: <JsPrincipal as LongRefFromWasmAbi>::Abi,
) -> <JsPrincipal as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <JsPrincipal as LongRefFromWasmAbi>::Abi, ) -> <JsPrincipal as LongRefFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
Source§impl OptionFromWasmAbi for JsPrincipal
impl OptionFromWasmAbi for JsPrincipal
Source§fn is_none(abi: &<JsPrincipal as FromWasmAbi>::Abi) -> bool
fn is_none(abi: &<JsPrincipal as FromWasmAbi>::Abi) -> bool
Tests whether the argument is a “none” instance. If so it will be
deserialized as
None
, and otherwise it will be passed to
FromWasmAbi
.Source§impl OptionIntoWasmAbi for JsPrincipal
impl OptionIntoWasmAbi for JsPrincipal
Source§fn none() -> <JsPrincipal as IntoWasmAbi>::Abi
fn none() -> <JsPrincipal as IntoWasmAbi>::Abi
Returns an ABI instance indicating “none”, which JS will interpret as
the
None
branch of this option. Read moreSource§impl RefFromWasmAbi for JsPrincipal
impl RefFromWasmAbi for JsPrincipal
Source§type Anchor = RcRef<JsPrincipal>
type Anchor = RcRef<JsPrincipal>
The type that holds the reference to
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§unsafe fn ref_from_abi(
js: <JsPrincipal as RefFromWasmAbi>::Abi,
) -> <JsPrincipal as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <JsPrincipal as RefFromWasmAbi>::Abi, ) -> <JsPrincipal as RefFromWasmAbi>::Anchor
Source§impl RefMutFromWasmAbi for JsPrincipal
impl RefMutFromWasmAbi for JsPrincipal
Source§type Anchor = RcRefMut<JsPrincipal>
type Anchor = RcRefMut<JsPrincipal>
Same as
RefFromWasmAbi::Anchor
Source§unsafe fn ref_mut_from_abi(
js: <JsPrincipal as RefMutFromWasmAbi>::Abi,
) -> <JsPrincipal as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <JsPrincipal as RefMutFromWasmAbi>::Abi, ) -> <JsPrincipal as RefMutFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
Source§impl TryFromJsValue for JsPrincipal
impl TryFromJsValue for JsPrincipal
Source§fn try_from_js_value(
value: JsValue,
) -> Result<JsPrincipal, <JsPrincipal as TryFromJsValue>::Error>
fn try_from_js_value( value: JsValue, ) -> Result<JsPrincipal, <JsPrincipal as TryFromJsValue>::Error>
Performs the conversion.
Source§impl VectorFromWasmAbi for JsPrincipal
impl VectorFromWasmAbi for JsPrincipal
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <JsPrincipal as VectorFromWasmAbi>::Abi, ) -> Box<[JsPrincipal]>
Source§impl VectorIntoWasmAbi for JsPrincipal
impl VectorIntoWasmAbi for JsPrincipal
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[JsPrincipal]>, ) -> <JsPrincipal as VectorIntoWasmAbi>::Abi
Auto Trait Implementations§
impl Freeze for JsPrincipal
impl RefUnwindSafe for JsPrincipal
impl Send for JsPrincipal
impl Sync for JsPrincipal
impl Unpin for JsPrincipal
impl UnwindSafe for JsPrincipal
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
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.