pub struct BenchmarkProjection {
pub targets: Vec<BenchmarkTarget>,
}Expand description
Every target of a registry against one repository.
Fields§
§targets: Vec<BenchmarkTarget>The targets, capabilities first (by id, transport, case), then the system ones, then the UI’s pages.
Implementations§
Source§impl BenchmarkProjection
impl BenchmarkProjection
Sourcepub fn from_context(ctx: &Context) -> Self
pub fn from_context(ctx: &Context) -> Self
Derive the targets: the cases need the index, so the projection is of a context.
Sourcepub fn pages(&self) -> impl Iterator<Item = &BenchmarkTarget>
pub fn pages(&self) -> impl Iterator<Item = &BenchmarkTarget>
The UI’s pages, in the order the targets list them.
use majordomus_cli::bench::{BenchmarkProjection, TargetKind};
let projection = BenchmarkProjection::from_context(ctx);
assert!(projection.pages().all(|t| matches!(t.kind, TargetKind::Page { .. })));
assert!(projection.pages().any(|t| t.key == "system.http.live.ui.index"));Sourcepub fn by_transport(
&self,
transport: Transport,
) -> impl Iterator<Item = &BenchmarkTarget>
pub fn by_transport( &self, transport: Transport, ) -> impl Iterator<Item = &BenchmarkTarget>
The targets of one transport.
Sourcepub fn of_capability<'a>(
&'a self,
id: &'a str,
) -> impl Iterator<Item = &'a BenchmarkTarget>
pub fn of_capability<'a>( &'a self, id: &'a str, ) -> impl Iterator<Item = &'a BenchmarkTarget>
The targets of one capability.
Sourcepub fn covers(&self, id: &str, transport: Transport) -> bool
pub fn covers(&self, id: &str, transport: Transport) -> bool
Is a capability exposed on a transport a target there? Coverage asks this.
Sourcepub fn is_command(registry: &CapabilityRegistry, id: &str) -> bool
pub fn is_command(registry: &CapabilityRegistry, id: &str) -> bool
Does the kind of a target make sense for a command? Commands are targets like queries; their side effect is this process’s memory.
Trait Implementations§
Source§impl Clone for BenchmarkProjection
impl Clone for BenchmarkProjection
Source§fn clone(&self) -> BenchmarkProjection
fn clone(&self) -> BenchmarkProjection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BenchmarkProjection
impl Debug for BenchmarkProjection
Source§impl<'de> Deserialize<'de> for BenchmarkProjection
impl<'de> Deserialize<'de> for BenchmarkProjection
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for BenchmarkProjection
Source§impl JsonSchema for BenchmarkProjection
impl JsonSchema for BenchmarkProjection
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for BenchmarkProjection
impl PartialEq for BenchmarkProjection
Source§fn eq(&self, other: &BenchmarkProjection) -> bool
fn eq(&self, other: &BenchmarkProjection) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for BenchmarkProjection
impl Serialize for BenchmarkProjection
impl StructuralPartialEq for BenchmarkProjection
Auto Trait Implementations§
impl Freeze for BenchmarkProjection
impl RefUnwindSafe for BenchmarkProjection
impl Send for BenchmarkProjection
impl Sync for BenchmarkProjection
impl Unpin for BenchmarkProjection
impl UnsafeUnpin for BenchmarkProjection
impl UnwindSafe for BenchmarkProjection
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
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.