pub struct RelationEndpoint { /* private fields */ }Expand description
A relation endpoint label with optionality metadata.
Implementations§
Source§impl RelationEndpoint
impl RelationEndpoint
Sourcepub fn new(
label: impl AsRef<str>,
required: bool,
) -> Result<RelationEndpoint, RelationError>
pub fn new( label: impl AsRef<str>, required: bool, ) -> Result<RelationEndpoint, RelationError>
Creates a relation endpoint label.
§Errors
Returns RelationError when the label is empty or contains control characters.
Sourcepub const fn is_required(&self) -> bool
pub const fn is_required(&self) -> bool
Returns whether this endpoint is required.
Sourcepub const fn is_optional(&self) -> bool
pub const fn is_optional(&self) -> bool
Returns whether this endpoint is optional.
Trait Implementations§
Source§impl Clone for RelationEndpoint
impl Clone for RelationEndpoint
Source§fn clone(&self) -> RelationEndpoint
fn clone(&self) -> RelationEndpoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RelationEndpoint
impl Debug for RelationEndpoint
Source§impl Hash for RelationEndpoint
impl Hash for RelationEndpoint
Source§impl Ord for RelationEndpoint
impl Ord for RelationEndpoint
Source§fn cmp(&self, other: &RelationEndpoint) -> Ordering
fn cmp(&self, other: &RelationEndpoint) -> Ordering
1.21.0 (const: unstable) · 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 for RelationEndpoint
impl PartialEq for RelationEndpoint
Source§fn eq(&self, other: &RelationEndpoint) -> bool
fn eq(&self, other: &RelationEndpoint) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for RelationEndpoint
impl PartialOrd for RelationEndpoint
impl Eq for RelationEndpoint
impl StructuralPartialEq for RelationEndpoint
Auto Trait Implementations§
impl Freeze for RelationEndpoint
impl RefUnwindSafe for RelationEndpoint
impl Send for RelationEndpoint
impl Sync for RelationEndpoint
impl Unpin for RelationEndpoint
impl UnsafeUnpin for RelationEndpoint
impl UnwindSafe for RelationEndpoint
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