pub struct Project { /* private fields */ }
Expand description
A “project” payload in an identity document.
Implementations§
Source§impl Project
impl Project
Sourcepub fn new(
name: ProjectName,
description: String,
default_branch: RefString,
) -> Result<Project, Vec<ProjectError>>
pub fn new( name: ProjectName, description: String, default_branch: RefString, ) -> Result<Project, Vec<ProjectError>>
Create a new Project
payload with the given values.
These values are subject to validation and any errors are returned in a vector.
§Validation Rules
name
’s length must not be empty and must not exceed 255.description
’s length must not exceed 255.default_branch
’s length must not be empty and must not exceed 255.
Sourcepub fn update(
self,
name: impl Into<Option<ProjectName>>,
description: impl Into<Option<String>>,
default_branch: impl Into<Option<RefString>>,
) -> Result<Project, Vec<ProjectError>>
pub fn update( self, name: impl Into<Option<ProjectName>>, description: impl Into<Option<String>>, default_branch: impl Into<Option<RefString>>, ) -> Result<Project, Vec<ProjectError>>
Update the Project
payload with new values, if provided.
When any of the values are set to None
then the original
value will be used, and so the value will pass validation.
Otherwise, the new value is used and will be subject to the
original validation rules (see Project::new
).
pub fn name(&self) -> &str
pub fn description(&self) -> &str
pub fn default_branch(&self) -> &RefString
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Project
impl<'de> Deserialize<'de> for Project
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Project, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Project, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Project
impl Serialize for Project
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Project
impl StructuralPartialEq for Project
Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnwindSafe for Project
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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