pub struct AppName(/* private fields */);
Expand description
Name of the application that is run by end users.
This is usually the crate name of the final binary. It needs to be passed in from the executable crate, as it is not possible for Peace to detect it within the library itself.
Must begin with a letter or underscore, and contain only letters, numbers, and underscores.
§Examples
The following are all examples of valid AppName
s:
let _default = app_name!(); // defaults to calling crate name
let _snake = app_name!("snake_case");
let _camel = app_name!("camelCase");
let _pascal = app_name!("PascalCase");
Implementations§
Methods from Deref<Target = Cow<'static, str>>§
Sourcepub fn is_borrowed(&self) -> bool
🔬This is a nightly-only experimental API. (cow_is_borrowed
)
pub fn is_borrowed(&self) -> bool
cow_is_borrowed
)Returns true if the data is borrowed, i.e. if to_mut
would require additional work.
§Examples
#![feature(cow_is_borrowed)]
use std::borrow::Cow;
let cow = Cow::Borrowed("moo");
assert!(cow.is_borrowed());
let bull: Cow<'_, str> = Cow::Owned("...moo?".to_string());
assert!(!bull.is_borrowed());
Sourcepub fn is_owned(&self) -> bool
🔬This is a nightly-only experimental API. (cow_is_borrowed
)
pub fn is_owned(&self) -> bool
cow_is_borrowed
)Returns true if the data is owned, i.e. if to_mut
would be a no-op.
§Examples
#![feature(cow_is_borrowed)]
use std::borrow::Cow;
let cow: Cow<'_, str> = Cow::Owned("moo".to_string());
assert!(cow.is_owned());
let bull = Cow::Borrowed("...moo?");
assert!(!bull.is_owned());
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppName
impl<'de> Deserialize<'de> for AppName
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
Source§impl Presentable for AppName
impl Presentable for AppName
Source§fn present<'output, 'life0, 'life1, 'async_trait, PR>(
&'life0 self,
presenter: &'life1 mut PR,
) -> Pin<Box<dyn Future<Output = Result<(), PR::Error>> + 'async_trait>>where
PR: Presenter<'output> + 'async_trait,
Self: 'async_trait,
'output: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn present<'output, 'life0, 'life1, 'async_trait, PR>(
&'life0 self,
presenter: &'life1 mut PR,
) -> Pin<Box<dyn Future<Output = Result<(), PR::Error>> + 'async_trait>>where
PR: Presenter<'output> + 'async_trait,
Self: 'async_trait,
'output: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Presents this data type to the user.
impl Eq for AppName
impl StructuralPartialEq for AppName
Auto Trait Implementations§
impl Freeze for AppName
impl RefUnwindSafe for AppName
impl Send for AppName
impl Sync for AppName
impl Unpin for AppName
impl UnwindSafe for AppName
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