pub struct Spec {
pub paths: HashMap<String, SpecPathItem>,
pub components: Option<SpecComponents>,
}Expand description
ESI OpenAPI spec type.
Fields§
§paths: HashMap<String, SpecPathItem>Map of URL path (e.g. /markets/{region_id}/orders) to its path item.
components: Option<SpecComponents>Reusable parts of the spec; only the security schemes are read.
Implementations§
Source§impl Spec
impl Spec
Sourcepub fn oauth_scopes(&self) -> Vec<String>
pub fn oauth_scopes(&self) -> Vec<String>
Every OAuth2 scope the spec defines, sorted.
Sourcepub fn scope_string_for(&self, op_ids: &[&str]) -> String
pub fn scope_string_for(&self, op_ids: &[&str]) -> String
The scopes needed to call every operation in op_ids, sorted and without
duplicates, as a space-separated list ready for EsiBuilder::scope.
Sourcepub fn operation(&self, op_id: &str) -> Option<&SpecPathMethod>
pub fn operation(&self, op_id: &str) -> Option<&SpecPathMethod>
Find an operation by its operationId.
Sourcepub fn required_scopes(&self, op_id: &str) -> Vec<String>
pub fn required_scopes(&self, op_id: &str) -> Vec<String>
The scopes an operation needs (empty for public operations).
Sourcepub fn rate_limit_groups(&self) -> HashMap<String, SpecRateLimit>
pub fn rate_limit_groups(&self) -> HashMap<String, SpecRateLimit>
The rate limit every operation declares, keyed by route group.
Sourcepub fn client_cache_ttl(&self, path: &str) -> Option<i64>
pub fn client_cache_ttl(&self, path: &str) -> Option<i64>
The x-client-cache-ttl of the GET operation whose path template matches
path (with or without the leading slash, e.g. characters/95465499).
Sourcepub fn tombstone_ttl(&self, path: &str) -> Option<i64>
pub fn tombstone_ttl(&self, path: &str) -> Option<i64>
The x-tombstone-ttl of the GET operation whose path template matches
path: how long ESI keeps answering for a deleted resource.
Sourcepub fn get_operation_for_path(&self, path: &str) -> Option<&SpecPathMethod>
pub fn get_operation_for_path(&self, path: &str) -> Option<&SpecPathMethod>
The GET operation whose path template matches a concrete path such as
characters/95465499. When several templates match, the one with the
most literal segments wins (characters/affiliation over
characters/{character_id}).
Sourcepub fn operation_index(&self) -> HashMap<String, String>
pub fn operation_index(&self) -> HashMap<String, String>
Build a map of operationId to URL path, with the path’s leading
slash removed so it can be appended to the base API URL.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Spec
impl<'de> Deserialize<'de> for Spec
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>,
impl Eq for Spec
impl StructuralPartialEq for Spec
Auto Trait Implementations§
impl Freeze for Spec
impl RefUnwindSafe for Spec
impl Send for Spec
impl Sync for Spec
impl Unpin for Spec
impl UnsafeUnpin for Spec
impl UnwindSafe for Spec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.