pub struct OwnerV3Helpers;
Implementations§
Source§impl OwnerV3Helpers
impl OwnerV3Helpers
Sourcepub fn is_init_secure_api(val: &Value) -> bool
pub fn is_init_secure_api(val: &Value) -> bool
Checks whether a request is to init the secure API
Sourcepub fn is_open_wallet(val: &Value) -> bool
pub fn is_open_wallet(val: &Value) -> bool
Checks whether a request is to open the wallet
Sourcepub fn is_encrypted_request(val: &Value) -> bool
pub fn is_encrypted_request(val: &Value) -> bool
Checks whether a request is an encrypted request
Sourcepub fn encryption_enabled(key: Arc<Mutex<Option<SecretKey>>>) -> bool
pub fn encryption_enabled(key: Arc<Mutex<Option<SecretKey>>>) -> bool
whether encryption is enabled
Sourcepub fn check_encryption_started(
key: Arc<Mutex<Option<SecretKey>>>,
) -> Result<(), Value>
pub fn check_encryption_started( key: Arc<Mutex<Option<SecretKey>>>, ) -> Result<(), Value>
If incoming is an encrypted request, check there is a shared key, Otherwise return an error value
Update the statically held owner API shared key
Sourcepub fn update_mask(mask: Arc<Mutex<Option<SecretKey>>>, val: &Value)
pub fn update_mask(mask: Arc<Mutex<Option<SecretKey>>>, val: &Value)
Update the shared mask, in case of foreign API being run
Sourcepub fn decrypt_request(
key: Arc<Mutex<Option<SecretKey>>>,
req: &Value,
) -> Result<(JsonId, Value), Value>
pub fn decrypt_request( key: Arc<Mutex<Option<SecretKey>>>, req: &Value, ) -> Result<(JsonId, Value), Value>
Decrypt an encrypted request
Sourcepub fn encrypt_response(
key: Arc<Mutex<Option<SecretKey>>>,
id: &JsonId,
res: &Value,
) -> Result<Value, Value>
pub fn encrypt_response( key: Arc<Mutex<Option<SecretKey>>>, id: &JsonId, res: &Value, ) -> Result<Value, Value>
Encrypt a response
Sourcepub fn check_error_response(val: &Value) -> (bool, Value)
pub fn check_error_response(val: &Value) -> (bool, Value)
convert an internal error (if exists) as proper JSON-RPC
Auto Trait Implementations§
impl Freeze for OwnerV3Helpers
impl RefUnwindSafe for OwnerV3Helpers
impl Send for OwnerV3Helpers
impl Sync for OwnerV3Helpers
impl Unpin for OwnerV3Helpers
impl UnwindSafe for OwnerV3Helpers
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more