Struct wrpc_transport::ResourceOwn

source ·
pub struct ResourceOwn<T: ?Sized> { /* private fields */ }
Expand description

Owned resource handle, represented as an opaque byte blob

Implementations§

source§

impl<T: ?Sized> ResourceOwn<T>

source

pub fn new(repr: impl Into<Bytes>) -> Self

Constructs a new owned resource handle

source

pub fn as_borrow(&self) -> ResourceBorrow<T>

Returns the owned handle as ResourceBorrow

Trait Implementations§

source§

impl<T: ?Sized> AsRef<[u8]> for ResourceOwn<T>

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T: ?Sized> AsRef<Bytes> for ResourceOwn<T>

source§

fn as_ref(&self) -> &Bytes

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T: ?Sized + 'static> Debug for ResourceOwn<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<R, T: ?Sized + Send + 'static> Decode<R> for ResourceOwn<T>

source§

type Decoder = ResourceOwnDecoder<T>

Decoder used to decode value
source§

type ListDecoder = CoreVecDecoder<<ResourceOwn<T> as Decode<R>>::Decoder>

Decoder used to decode lists of value
source§

impl<T: ?Sized, W> Encode<W> for &ResourceOwn<T>

source§

type Encoder = ResourceEncoder

Encoder used to encode the value
source§

fn encode( self, enc: &mut Self::Encoder, dst: &mut BytesMut, ) -> Result<Option<DeferredFn<T>>, <Self::Encoder as Encoder<Self>>::Error>

Convenience function for encoding a value
source§

impl<T: ?Sized, W> Encode<W> for ResourceOwn<T>

source§

type Encoder = ResourceEncoder

Encoder used to encode the value
source§

fn encode( self, enc: &mut Self::Encoder, dst: &mut BytesMut, ) -> Result<Option<DeferredFn<T>>, <Self::Encoder as Encoder<Self>>::Error>

Convenience function for encoding a value
source§

impl<T: ?Sized> Encoder<&ResourceOwn<T>> for ResourceEncoder

source§

type Error = Error

The type of encoding errors. Read more
source§

fn encode(&mut self, item: &ResourceOwn<T>, dst: &mut BytesMut) -> Result<()>

Encodes a frame into the buffer provided. Read more
source§

impl<T: ?Sized> Encoder<ResourceOwn<T>> for ResourceEncoder

source§

type Error = Error

The type of encoding errors. Read more
source§

fn encode(&mut self, item: ResourceOwn<T>, dst: &mut BytesMut) -> Result<()>

Encodes a frame into the buffer provided. Read more
source§

impl<T: ?Sized> From<Bytes> for ResourceOwn<T>

source§

fn from(repr: Bytes) -> Self

Converts to this type from the input type.
source§

impl<T: ?Sized> From<ResourceOwn<T>> for Bytes

source§

fn from(_: ResourceOwn<T>) -> Self

Converts to this type from the input type.
source§

impl<T: ?Sized> From<ResourceOwn<T>> for ResourceBorrow<T>

source§

fn from(_: ResourceOwn<T>) -> Self

Converts to this type from the input type.
source§

impl<T: ?Sized> From<Vec<u8>> for ResourceOwn<T>

source§

fn from(repr: Vec<u8>) -> Self

Converts to this type from the input type.
source§

impl<T: ?Sized> Hash for ResourceOwn<T>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T: ?Sized> PartialEq for ResourceOwn<T>

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: ?Sized> Eq for ResourceOwn<T>

Auto Trait Implementations§

§

impl<T> !Freeze for ResourceOwn<T>

§

impl<T> RefUnwindSafe for ResourceOwn<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Send for ResourceOwn<T>
where T: Send + ?Sized,

§

impl<T> Sync for ResourceOwn<T>
where T: Sync + ?Sized,

§

impl<T> Unpin for ResourceOwn<T>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for ResourceOwn<T>
where T: UnwindSafe + ?Sized,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more