pub enum Safety {
Safe,
Unsafe,
Unknown(String),
}Expand description
Whether an operation requires unsafe.
Variants§
Implementations§
Source§impl Safety
impl Safety
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if this is a Safety::Unknown, otherwise false
Sourcepub fn as_unknown_mut(&mut self) -> Option<&mut String>
pub fn as_unknown_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a Safety::Unknown, otherwise None
Sourcepub fn as_unknown(&self) -> Option<&String>
pub fn as_unknown(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a Safety::Unknown, otherwise None
Sourcepub fn into_unknown(self) -> Result<String, Self>
pub fn into_unknown(self) -> Result<String, Self>
Returns the inner fields if this is a Safety::Unknown, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_unknown_unchecked(self) -> String
pub unsafe fn into_unknown_unchecked(self) -> String
Unchecked return of the inner fields of Safety::Unknown.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_unknown_unchecked(&self) -> &String
pub unsafe fn as_unknown_unchecked(&self) -> &String
Unchecked reference of the inner fields of Safety::Unknown.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_unknown_mut_unchecked(&mut self) -> &mut String
pub unsafe fn as_unknown_mut_unchecked(&mut self) -> &mut String
Unchecked mutable reference of the inner fields of Safety::Unknown.
§Safety
Results in undefined behavior when it is the incorrect variant.
Trait Implementations§
impl Eq for Safety
Source§impl FromIterator<Safety> for Safety
Combine the safety of all the elements, see Safety::or_else. We stop consuming the iterator
once we know the result is Unsafe.
impl FromIterator<Safety> for Safety
Combine the safety of all the elements, see Safety::or_else. We stop consuming the iterator
once we know the result is Unsafe.
impl StructuralPartialEq for Safety
Auto Trait Implementations§
impl Freeze for Safety
impl RefUnwindSafe for Safety
impl Send for Safety
impl Sync for Safety
impl Unpin for Safety
impl UnsafeUnpin for Safety
impl UnwindSafe for Safety
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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