pub struct License(pub Option<(String, LicenseFunc)>);
Expand description
License shows license information
Tuple Fields
0: Option<(String, LicenseFunc)>
Implementations
sourceimpl License
impl License
sourcepub fn new(inner: Option<(String, LicenseFunc)>) -> Self
pub fn new(inner: Option<(String, LicenseFunc)>) -> Self
Creates new License information.
sourcepub fn expr(&self) -> Option<String>
pub fn expr(&self) -> Option<String>
Returns (short) expression of license. If no license information(self is License(None)), returns None.
sourcepub fn expr_unwrap(&self) -> String
pub fn expr_unwrap(&self) -> String
Returns (short) expression of license. If no license information(self is License(None)), this function may panic.
sourcepub fn output(&self, cmd: &Command, ctx: &Context) -> Option<String>
pub fn output(&self, cmd: &Command, ctx: &Context) -> Option<String>
Returns (long) expression - detail of license.
sourcepub fn output_unwrap(&self, cmd: &Command, ctx: &Context) -> String
pub fn output_unwrap(&self, cmd: &Command, ctx: &Context) -> String
Returns (long) expression - detail of license. If self is License(None), this function may panic.
sourcepub fn output_fn(&self) -> Option<LicenseFunc>
pub fn output_fn(&self) -> Option<LicenseFunc>
Returns function which outputs (long) expression (or detail of license) with wrapping Option.
sourcepub fn output_fn_unwrap(&self) -> LicenseFunc
pub fn output_fn_unwrap(&self) -> LicenseFunc
Returns function of (long) expression (or detail of license). If self is License(None), this will panic.
sourcepub fn unwrap(self) -> (String, LicenseFunc)
pub fn unwrap(self) -> (String, LicenseFunc)
Returns unwrap inner
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for License
impl Send for License
impl Sync for License
impl Unpin for License
impl UnwindSafe for License
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more