pub struct AuthScopes { /* private fields */ }Expand description
A set of OAuth scopes for Shopify API access.
This type handles parsing, deduplication, and implied scope logic.
For example, write_products implies read_products.
§Implied Scopes
Shopify’s scope system includes implied scopes:
write_productsimpliesread_productsunauthenticated_write_productsimpliesunauthenticated_read_products
This type automatically expands implied scopes when parsing.
§Serialization
AuthScopes serializes to and deserializes from a comma-separated string
for compact JSON representation:
use shopify_sdk::AuthScopes;
let scopes: AuthScopes = "read_products,write_orders".parse().unwrap();
let json = serde_json::to_string(&scopes).unwrap();
// JSON: "\"read_orders,read_products,write_orders\""§Example
use shopify_sdk::AuthScopes;
let scopes: AuthScopes = "read_products, write_orders".parse().unwrap();
assert!(!scopes.is_empty());
// Check if scopes cover another set
let required: AuthScopes = "read_products".parse().unwrap();
assert!(scopes.covers(&required));Implementations§
Trait Implementations§
Source§impl Clone for AuthScopes
impl Clone for AuthScopes
Source§fn clone(&self) -> AuthScopes
fn clone(&self) -> AuthScopes
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 AuthScopes
impl Debug for AuthScopes
Source§impl Default for AuthScopes
impl Default for AuthScopes
Source§fn default() -> AuthScopes
fn default() -> AuthScopes
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AuthScopes
impl<'de> Deserialize<'de> for AuthScopes
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for AuthScopes
impl Display for AuthScopes
Source§impl FromStr for AuthScopes
impl FromStr for AuthScopes
Source§impl PartialEq for AuthScopes
impl PartialEq for AuthScopes
Source§impl Serialize for AuthScopes
impl Serialize for AuthScopes
impl Eq for AuthScopes
impl StructuralPartialEq for AuthScopes
Auto Trait Implementations§
impl Freeze for AuthScopes
impl RefUnwindSafe for AuthScopes
impl Send for AuthScopes
impl Sync for AuthScopes
impl Unpin for AuthScopes
impl UnwindSafe for AuthScopes
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.