pub trait IndexesExt {
// Required method
fn retain_actual_by_till(&mut self);
// Provided method
fn into_actual_by_till(self) -> Self
where Self: Sized { ... }
}Expand description
Методы fluent-интерфейса для коллекции индексов.
Required Methods§
Sourcefn retain_actual_by_till(&mut self)
fn retain_actual_by_till(&mut self)
Оставить только индексы с максимальным till.
Provided Methods§
Sourcefn into_actual_by_till(self) -> Selfwhere
Self: Sized,
fn into_actual_by_till(self) -> Selfwhere
Self: Sized,
Вернуть коллекцию индексов только с максимальным till.
Examples found in repository?
examples/actual_indexes_dump.rs (line 84)
83fn load_actual_index_dumps(moex_client: &Client) -> Result<Vec<IndexDump>, ExampleError> {
84 let indexes = with_retry(retry_policy(), || moex_client.indexes())?.into_actual_by_till();
85 let page_limit = NonZeroU32::new(INDEX_ANALYTICS_PAGE_LIMIT)
86 .expect("INDEX_ANALYTICS_PAGE_LIMIT constant must be greater than zero");
87
88 indexes
89 .into_iter()
90 .map(|index| {
91 let components = with_retry(retry_policy(), || {
92 moex_client
93 .index(index.id().clone())
94 .expect("index id from payload must be valid")
95 .analytics_pages(page_limit)
96 .all()
97 })?
98 .into_actual_by_session()
99 .into_sorted_by_weight_desc();
100 Ok(IndexDump {
101 index_id: index.id().as_str().to_owned().into_boxed_str(),
102 short_name: index.short_name().to_owned().into_boxed_str(),
103 components,
104 })
105 })
106 .collect()
107}Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".