pub struct IndexScope<'a> { /* private fields */ }Expand description
Основные paginator-ы и scope-типы блокирующего API.
Блокирующие HTTP-клиенты ISS API.
Blocking scope по indexid, владеющий значением.
Полезен для ergonomic-chain, где вход передаётся как impl TryInto<IndexId>.
Implementations§
Source§impl<'a> OwnedIndexScope<'a>
impl<'a> OwnedIndexScope<'a>
Sourcepub fn analytics(
&self,
page_request: PageRequest,
) -> Result<Vec<IndexAnalytics>, MoexError>
pub fn analytics( &self, page_request: PageRequest, ) -> Result<Vec<IndexAnalytics>, MoexError>
Получить состав индекса (analytics) по текущему owning-scope.
Sourcepub fn analytics_pages(&self, page_limit: NonZeroU32) -> IndexAnalyticsPages<'_>
pub fn analytics_pages(&self, page_limit: NonZeroU32) -> IndexAnalyticsPages<'_>
Создать ленивый paginator страниц analytics для текущего индекса.
Examples found in repository?
examples/actual_indexes_dump.rs (line 79)
67fn load_actual_index_dumps(moex_client: &Client) -> Result<Vec<IndexDump>, ExampleError> {
68 let indexes = with_retry(retry_policy(), || moex_client.indexes())?.into_actual_by_till();
69 let page_limit = NonZeroU32::new(INDEX_ANALYTICS_PAGE_LIMIT)
70 .expect("INDEX_ANALYTICS_PAGE_LIMIT constant must be greater than zero");
71
72 indexes
73 .into_iter()
74 .map(|index| {
75 let components = with_retry(retry_policy(), || {
76 moex_client
77 .index(index.id().clone())
78 .expect("index id from payload must be valid")
79 .analytics_pages(page_limit)
80 .all()
81 })?
82 .into_actual_by_session()
83 .into_sorted_by_weight_desc();
84 Ok(IndexDump {
85 index_id: index.id().as_str().to_owned().into_boxed_str(),
86 short_name: index.short_name().to_owned().into_boxed_str(),
87 components,
88 })
89 })
90 .collect()
91}Trait Implementations§
Source§impl<'a> Clone for OwnedIndexScope<'a>
impl<'a> Clone for OwnedIndexScope<'a>
Source§fn clone(&self) -> OwnedIndexScope<'a>
fn clone(&self) -> OwnedIndexScope<'a>
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 moreAuto Trait Implementations§
impl<'a> Freeze for OwnedIndexScope<'a>
impl<'a> !RefUnwindSafe for OwnedIndexScope<'a>
impl<'a> Send for OwnedIndexScope<'a>
impl<'a> Sync for OwnedIndexScope<'a>
impl<'a> Unpin for OwnedIndexScope<'a>
impl<'a> UnsafeUnpin for OwnedIndexScope<'a>
impl<'a> !UnwindSafe for OwnedIndexScope<'a>
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