Struct etcetera::app_strategy::AppStrategyArgs
source · pub struct AppStrategyArgs {
pub top_level_domain: String,
pub author: String,
pub app_name: String,
}
Expand description
The arguments to the creator method of an AppStrategy
.
Fields§
§top_level_domain: String
The top level domain of the application, e.g. com
, org
, or io.github
.
The name of the author of the application.
app_name: String
The application’s name. This should be capitalised if appropriate.
Implementations§
source§impl AppStrategyArgs
impl AppStrategyArgs
sourcepub fn bundle_id(&self) -> String
pub fn bundle_id(&self) -> String
Constructs a bunde identifier from an AppStrategyArgs
.
use etcetera::app_strategy::AppStrategyArgs;
let strategy_args = AppStrategyArgs {
top_level_domain: "org".to_string(),
author: "Acme Corp".to_string(),
app_name: "Frobnicator Plus".to_string(),
};
assert_eq!(strategy_args.bundle_id().replace(' ', ""), "org.acmecorp.FrobnicatorPlus".to_string());
sourcepub fn unixy_name(&self) -> String
pub fn unixy_name(&self) -> String
Returns a ‘unixy’ version of the application’s name, akin to what would usually be used as a binary name.
use etcetera::app_strategy::AppStrategyArgs;
let strategy_args = AppStrategyArgs {
top_level_domain: "org".to_string(),
author: "Acme Corp".to_string(),
app_name: "Frobnicator Plus".to_string(),
};
assert_eq!(strategy_args.unixy_name(), "frobnicator-plus".to_string());
Trait Implementations§
source§impl Clone for AppStrategyArgs
impl Clone for AppStrategyArgs
source§fn clone(&self) -> AppStrategyArgs
fn clone(&self) -> AppStrategyArgs
Returns a copy of the value. Read more
1.0.0 · 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 AppStrategyArgs
impl Debug for AppStrategyArgs
source§impl Default for AppStrategyArgs
impl Default for AppStrategyArgs
source§fn default() -> AppStrategyArgs
fn default() -> AppStrategyArgs
Returns the “default value” for a type. Read more
source§impl Hash for AppStrategyArgs
impl Hash for AppStrategyArgs
source§impl Ord for AppStrategyArgs
impl Ord for AppStrategyArgs
source§fn cmp(&self, other: &AppStrategyArgs) -> Ordering
fn cmp(&self, other: &AppStrategyArgs) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<AppStrategyArgs> for AppStrategyArgs
impl PartialEq<AppStrategyArgs> for AppStrategyArgs
source§fn eq(&self, other: &AppStrategyArgs) -> bool
fn eq(&self, other: &AppStrategyArgs) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<AppStrategyArgs> for AppStrategyArgs
impl PartialOrd<AppStrategyArgs> for AppStrategyArgs
source§fn partial_cmp(&self, other: &AppStrategyArgs) -> Option<Ordering>
fn partial_cmp(&self, other: &AppStrategyArgs) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for AppStrategyArgs
impl StructuralEq for AppStrategyArgs
impl StructuralPartialEq for AppStrategyArgs
Auto Trait Implementations§
impl RefUnwindSafe for AppStrategyArgs
impl Send for AppStrategyArgs
impl Sync for AppStrategyArgs
impl Unpin for AppStrategyArgs
impl UnwindSafe for AppStrategyArgs
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