pub struct LicenseBuilder<S: State = Empty> { /* private fields */ }
Expand description
Use builder syntax to set the inputs and finish with build()
.
Implementations§
Source§impl<S: State> LicenseBuilder<S>
impl<S: State> LicenseBuilder<S>
Sourcepub fn build(self) -> Licensewhere
S: IsComplete,
pub fn build(self) -> Licensewhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn name(self, value: impl Into<String>) -> LicenseBuilder<SetName<S>>where
S::Name: IsUnset,
pub fn name(self, value: impl Into<String>) -> LicenseBuilder<SetName<S>>where
S::Name: IsUnset,
Required.
Name of the license used e.g MIT or Apache-2.0.
Sourcepub fn url(self, value: impl Into<String>) -> LicenseBuilder<SetUrl<S>>where
S::Url: IsUnset,
pub fn url(self, value: impl Into<String>) -> LicenseBuilder<SetUrl<S>>where
S::Url: IsUnset,
Sourcepub fn maybe_url(
self,
value: Option<impl Into<String>>,
) -> LicenseBuilder<SetUrl<S>>where
S::Url: IsUnset,
pub fn maybe_url(
self,
value: Option<impl Into<String>>,
) -> LicenseBuilder<SetUrl<S>>where
S::Url: IsUnset,
Sourcepub fn identifier(
self,
value: impl Into<String>,
) -> LicenseBuilder<SetIdentifier<S>>where
S::Identifier: IsUnset,
pub fn identifier(
self,
value: impl Into<String>,
) -> LicenseBuilder<SetIdentifier<S>>where
S::Identifier: IsUnset,
Optional (Some / Option setters).
An SPDX-Licenses expression for the API. The identifier
field
is mutually exclusive of the url
field. E.g. Apache-2.0
Sourcepub fn maybe_identifier(
self,
value: Option<impl Into<String>>,
) -> LicenseBuilder<SetIdentifier<S>>where
S::Identifier: IsUnset,
pub fn maybe_identifier(
self,
value: Option<impl Into<String>>,
) -> LicenseBuilder<SetIdentifier<S>>where
S::Identifier: IsUnset,
Optional (Some / Option setters).
An SPDX-Licenses expression for the API. The identifier
field
is mutually exclusive of the url
field. E.g. Apache-2.0
Sourcepub fn extensions(
self,
value: impl Into<Extensions>,
) -> LicenseBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
pub fn extensions(
self,
value: impl Into<Extensions>,
) -> LicenseBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
Sourcepub fn maybe_extensions(
self,
value: Option<impl Into<Extensions>>,
) -> LicenseBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
pub fn maybe_extensions(
self,
value: Option<impl Into<Extensions>>,
) -> LicenseBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
Trait Implementations§
Source§impl<S: IsComplete> From<LicenseBuilder<S>> for License
impl<S: IsComplete> From<LicenseBuilder<S>> for License
Source§fn from(builder: LicenseBuilder<S>) -> Self
fn from(builder: LicenseBuilder<S>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<S> Freeze for LicenseBuilder<S>
impl<S> RefUnwindSafe for LicenseBuilder<S>
impl<S> Send for LicenseBuilder<S>
impl<S> Sync for LicenseBuilder<S>
impl<S> Unpin for LicenseBuilder<S>
impl<S> UnwindSafe for LicenseBuilder<S>
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