About

Struct About 

Source
#[non_exhaustive]
pub struct About { pub pkg_name: Txt, pub pkg_authors: Box<[Txt]>, pub version: Version, pub app_id: Txt, pub app: Txt, pub org: Txt, pub description: Txt, pub homepage: Txt, pub license: Txt, pub has_about: bool, pub meta: Vec<(Txt, Txt)>, pub is_test: bool, }
Expand description

Metadata about the app and main crate.

See about for more details.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§pkg_name: Txt

package.name

Cargo crate name for the entry crate.

§pkg_authors: Box<[Txt]>

package.authors

Cargo crate authors for the entry crate.

§version: Version

package.version

Cargo crate version for the entry crate.

§app_id: Txt

package.metadata.zng.about.app_id

Fully qualified unique name for the application. Is a list of one or more dot-separated identifiers, each identifier starts with letter, identifiers contains only letters, digits and underscore. A reverse DNS name is recommended.

If the metadata is not set an id is derived from "qualifier", org and app values.

§app: Txt

package.metadata.zng.about.app

App display name.

If the metadata is not set the pkg_name is used.

§org: Txt

package.metadata.zng.about.org

Organization display name.

If the metadata is not set the first pkg_authors is used.

§description: Txt

package.description

Short description of the app.

§homepage: Txt

package.homepage

Valid website about the app.

§license: Txt

package.license

License title of the app.

§has_about: bool

If package.metadata.zng.about is set on the Cargo.toml manifest.

The presence of this section is used by cargo zng res to find the main crate if the workspace has multiple bin crates.

§meta: Vec<(Txt, Txt)>

package.metadata.zng.about.*

Any other unknown string metadata.

§is_test: bool

If app was started in a cfg(test) build binary.

Implementations§

Source§

impl About

Source

pub fn crate_name(&self) -> Txt

The pkg_name in snake_case.

Source

pub fn qualifier(&self) -> Txt

The first components of app_id except the last two.

For app id "br.com.company.product" the qualifier is "br.com". For id "company.product" the qualifier is empty.

Source

pub fn get(&self, key: &str) -> Option<Txt>

Get the value.

The key can be an entry of meta, the name of a field or the name of a value method.

Source§

impl About

Source

pub fn parse_manifest(cargo_toml: &str) -> Result<Self, Error>

Parse a Cargo.toml string.

Trait Implementations§

Source§

impl Clone for About

Source§

fn clone(&self) -> About

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for About

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for About

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for About

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for About

Source§

fn eq(&self, other: &About) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for About

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for About

Source§

impl StructuralPartialEq for About

Auto Trait Implementations§

§

impl Freeze for About

§

impl RefUnwindSafe for About

§

impl Send for About

§

impl Sync for About

§

impl Unpin for About

§

impl UnwindSafe for About

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,