pub struct MappingResponses(/* private fields */);Expand description
Ergonomic wrapper for batch responses from the OpenFIGI mapping endpoint (POST /v3/mapping).
This type represents the complete response from the mapping endpoint, which returns
an array of results corresponding to each mapping request submitted in the batch.
Each mapping request in the batch gets its own result in the response array, which is
either a successful MappingData or an OpenFIGIError describing why the mapping failed.
§Usage
- Use
MappingResponses::successes()to iterate over all successful mapping results. - Use
MappingResponses::failures()to iterate over all errors that occurred for individual requests. - Use
MappingResponses::len()andMappingResponses::is_empty()for batch size checks.
Implementations§
Source§impl MappingResponses
impl MappingResponses
Sourcepub fn successes(&self) -> impl Iterator<Item = (usize, &MappingData)>
pub fn successes(&self) -> impl Iterator<Item = (usize, &MappingData)>
Returns an iterator over all successful mapping results in the batch, with their indices.
Each item is a tuple (index, &MappingData) for a request that was successfully mapped.
Sourcepub fn failures(&self) -> impl Iterator<Item = (usize, &OpenFIGIError)>
pub fn failures(&self) -> impl Iterator<Item = (usize, &OpenFIGIError)>
Returns an iterator over all errors for failed mapping requests in the batch, with their indices.
Each item is a tuple (index, &OpenFIGIError) for a request that failed to map.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the total number of mapping results (successes + failures) in the batch.
Sourcepub fn as_slice(&self) -> &[Result<MappingData>] ⓘ
pub fn as_slice(&self) -> &[Result<MappingData>] ⓘ
Returns a reference to the underlying vector of results, preserving order and index.