MCPcopy Create free account
hub / github.com/dtantsur/rust-openstack / ResourceQuery

Interface ResourceQuery

src/common/resourceiterator.rs:30–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28/// This is a low-level trait that should not be used directly.
29#[async_trait]
30pub trait ResourceQuery {
31 /// Item type.
32 type Item;
33
34 /// Default limit to use with this query.
35 const DEFAULT_LIMIT: usize;
36
37 /// Whether pagination is supported for this query.
38 async fn can_paginate(&self) -> Result<bool>;
39
40 /// Extract a marker from a resource.
41 fn extract_marker(&self, resource: &Self::Item) -> String;
42
43 /// Get a chunk of resources.
44 async fn fetch_chunk(
45 &self,
46 limit: Option<usize>,
47 marker: Option<String>,
48 ) -> Result<Vec<Self::Item>>;
49
50 /// Validate the query before the first execution.
51 ///
52 /// This call may modify internal representation of the query, so changing
53 /// the query after calling it may cause undesired side effects.
54 async fn validate(&mut self) -> Result<()> {
55 Ok(())
56 }
57}
58
59/// Generic iterator over resources.
60#[derive(Debug, Clone)]

Callers

nothing calls this directly

Implementers 12

nodes.rssrc/baremetal/nodes.rs
images.rssrc/image/images.rs
ports.rssrc/network/ports.rs
floatingips.rssrc/network/floatingips.rs
routers.rssrc/network/routers.rs
networks.rssrc/network/networks.rs
subnets.rssrc/network/subnets.rs
resourceiterator.rssrc/common/resourceiterator.rs
volumes.rssrc/block_storage/volumes.rs
servers.rssrc/compute/servers.rs
keypairs.rssrc/compute/keypairs.rs
flavors.rssrc/compute/flavors.rs

Calls

no outgoing calls

Tested by

no test coverage detected