pub trait ReadOnlyResource: RestResource { }Expand description
A marker trait for REST resources that only support read operations.
Resources implementing this trait only support GET requests (find, all, count) and do not have Create, Update, or Delete operations. This serves as compile-time documentation of the resource’s capabilities and can be used for blanket implementations that restrict certain behaviors.
§Resources with this trait
The following Shopify resources are read-only:
Event- Store events (read-only audit log)Policy- Store legal policiesLocation- Store locationsCurrency- Enabled currenciesUser- Store staff usersAccessScope- App access scopes
§Example
ⓘ
use shopify_sdk::rest::{RestResource, ReadOnlyResource};
// Location only supports GET operations
impl RestResource for Location {
const PATHS: &'static [ResourcePath] = &[
ResourcePath::new(HttpMethod::Get, ResourceOperation::Find, &["id"], "locations/{id}"),
ResourcePath::new(HttpMethod::Get, ResourceOperation::All, &[], "locations"),
ResourcePath::new(HttpMethod::Get, ResourceOperation::Count, &[], "locations/count"),
// No Create, Update, or Delete paths
];
// ...
}
// Mark as read-only
impl ReadOnlyResource for Location {}Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl ReadOnlyResource for shopify_sdk::rest::resources::v2025_10::AccessScope
impl ReadOnlyResource for shopify_sdk::rest::resources::v2026_04::AccessScope
impl ReadOnlyResource for shopify_sdk::rest::resources::v2025_10::Currency
impl ReadOnlyResource for shopify_sdk::rest::resources::v2026_04::Currency
impl ReadOnlyResource for shopify_sdk::rest::resources::v2025_10::Event
impl ReadOnlyResource for shopify_sdk::rest::resources::v2026_04::Event
impl ReadOnlyResource for shopify_sdk::rest::resources::v2025_10::Location
Marker trait implementation indicating Location is read-only.
impl ReadOnlyResource for shopify_sdk::rest::resources::v2026_04::Location
Marker trait implementation indicating Location is read-only.