pub struct ExtGift<M: 'static>(/* private fields */);Expand description
A handle to a value registered via ExtContext::register, in a wire
position that grants the peer a reference to it.
Uses a distinct Marker type parameter rather than the concrete stored
type so the handle a caller holds does not need to name (or even know)
the private type actually retained behind it — the same design
dolang_rpc::session::Gift uses for its own object table.
Opaque by design: the direct/remote split is an implementation detail, not something extension authors match on.
Implementations§
Source§impl<M> ExtGift<M>
impl<M> ExtGift<M>
Sourcepub fn cite(&self) -> ExtCite<M>
pub fn cite(&self) -> ExtCite<M>
Names this resource back to the endpoint that owns it, for a wire position that must not transfer a reference.
§Panics
In remote mode, if this endpoint is itself the owner — see
dolang_rpc::session::Gift::cite. Direct mode has no wire and no
owner, so it cannot fail this way; extensions should still route
through here so that the two modes agree.
Trait Implementations§
Source§impl<'de, M: 'static> Deserialize<'de> for ExtGift<M>
impl<'de, M: 'static> Deserialize<'de> for ExtGift<M>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Auto Trait Implementations§
impl<M> !RefUnwindSafe for ExtGift<M>
impl<M> !UnwindSafe for ExtGift<M>
impl<M> Freeze for ExtGift<M>where
GiftRepr<M>: Freeze,
impl<M> Send for ExtGift<M>where
GiftRepr<M>: Send,
impl<M> Sync for ExtGift<M>where
GiftRepr<M>: Sync,
impl<M> Unpin for ExtGift<M>where
GiftRepr<M>: Unpin,
impl<M> UnsafeUnpin for ExtGift<M>where
GiftRepr<M>: UnsafeUnpin,
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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