pub struct Example {
pub name: String,
pub display_name: String,
pub manifest_path: String,
pub kind: TargetKind,
pub extended: bool,
}Expand description
Represents an example or binary that can be executed using cargo-e.
This struct holds metadata about a runnable target within a Rust project.
§Fields
name: The actual name of the target (e.g.,"hello_world").display_name: A formatted name used for display purposes.manifest_path: The path to theCargo.tomlfile defining the target.kind: Specifies whether the target is an example or a binary.extended: Indicates whether the example is located in an extended directory.
§Example
use cargo_e::{Example, TargetKind};
let example = Example {
name: "demo".to_string(),
display_name: "Demo Example".to_string(),
manifest_path: "examples/demo/Cargo.toml".to_string(),
kind: TargetKind::Example,
extended: true,
};
assert_eq!(example.name, "demo");
assert!(example.extended);Fields§
§name: String§display_name: String§manifest_path: String§kind: TargetKind§extended: boolTrait Implementations§
Source§impl Ord for Example
impl Ord for Example
Source§impl PartialOrd for Example
impl PartialOrd for Example
impl Eq for Example
impl StructuralPartialEq for Example
Auto Trait Implementations§
impl Freeze for Example
impl RefUnwindSafe for Example
impl Send for Example
impl Sync for Example
impl Unpin for Example
impl UnwindSafe for Example
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more