Skip to main content

ExtensionsTransfer

Trait ExtensionsTransfer 

pub trait ExtensionsTransfer:
    Send
    + Sync
    + 'static {
    // Required method
    fn transfer(&self, parent: &Extensions, child: &Extensions);

    // Provided methods
    fn and<T>(self, other: T) -> ExtensionsTransferAnd<Self, T>
       where T: ExtensionsTransfer,
             Self: Sized { ... }
    fn into_shared(self) -> SharedExtensionsTransfer
       where Self: Sized { ... }
}
Expand description

What a child connection keeps from its parent connection.

A Extensions::fork_connection boundary stops every ExtensionScope::Connection fact of the parent connection. Some of those facts still matter for the child, and only the site that forks the connection knows which: the extension types cannot say, and neither can the layers that published them. So every site that forks a connection owns a transfer and exposes it for configuration.

Required Methods§

fn transfer(&self, parent: &Extensions, child: &Extensions)

Put onto child what it keeps from the parent chain it forks from.

Provided Methods§

fn and<T>(self, other: T) -> ExtensionsTransferAnd<Self, T>
where T: ExtensionsTransfer, Self: Sized,

Run self, then other.

fn into_shared(self) -> SharedExtensionsTransfer
where Self: Sized,

Erase and share this transfer, so a connector can hold it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§