pub struct ApiSecretKey(/* private fields */);Expand description
A validated Shopify API secret key.
This newtype ensures the secret key is non-empty and masks its value in debug output to prevent accidental exposure in logs.
§Security
The Debug implementation masks the secret value, displaying only
ApiSecretKey(*****) instead of the actual key.
§Example
use shopify_sdk::ApiSecretKey;
let secret = ApiSecretKey::new("my-secret").unwrap();
assert_eq!(format!("{:?}", secret), "ApiSecretKey(*****)");Implementations§
Source§impl ApiSecretKey
impl ApiSecretKey
Sourcepub fn new(key: impl Into<String>) -> Result<Self, ConfigError>
pub fn new(key: impl Into<String>) -> Result<Self, ConfigError>
Creates a new validated API secret key.
§Errors
Returns ConfigError::EmptyApiSecretKey if the key is empty.
Trait Implementations§
Source§impl AsRef<str> for ApiSecretKey
impl AsRef<str> for ApiSecretKey
Source§impl Clone for ApiSecretKey
impl Clone for ApiSecretKey
Source§fn clone(&self) -> ApiSecretKey
fn clone(&self) -> ApiSecretKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiSecretKey
impl Debug for ApiSecretKey
Source§impl PartialEq for ApiSecretKey
impl PartialEq for ApiSecretKey
impl Eq for ApiSecretKey
impl StructuralPartialEq for ApiSecretKey
Auto Trait Implementations§
impl Freeze for ApiSecretKey
impl RefUnwindSafe for ApiSecretKey
impl Send for ApiSecretKey
impl Sync for ApiSecretKey
impl Unpin for ApiSecretKey
impl UnwindSafe for ApiSecretKey
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.