pub struct OpaqueType {
pub visibility: Visibility,
pub name: Ident,
pub generics: GenericParams,
pub underlying: Type,
pub span: Span,
}Expand description
Opaque type definition: opaque type UserId = i64;
Zero-cost type distinction — the underlying type is erased from the public API. Only the defining module can construct/deconstruct values of the opaque type.
Fields§
§visibility: Visibility§name: Ident§generics: GenericParams§underlying: Type§span: SpanTrait Implementations§
Source§impl Clone for OpaqueType
impl Clone for OpaqueType
Source§fn clone(&self) -> OpaqueType
fn clone(&self) -> OpaqueType
Returns a duplicate of the value. Read more
1.0.0 · 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 OpaqueType
impl Debug for OpaqueType
Source§impl PartialEq for OpaqueType
impl PartialEq for OpaqueType
impl StructuralPartialEq for OpaqueType
Auto Trait Implementations§
impl Freeze for OpaqueType
impl RefUnwindSafe for OpaqueType
impl Send for OpaqueType
impl Sync for OpaqueType
impl Unpin for OpaqueType
impl UnwindSafe for OpaqueType
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