Skip to main content

TransientSourceRegistry

Struct TransientSourceRegistry 

Source
pub struct TransientSourceRegistry { /* private fields */ }

Implementations§

Source§

impl TransientSourceRegistry

Source

pub fn new() -> Self

Source

pub fn register( &self, name: impl Into<String>, builder: impl Fn(&TransientContext) -> TransientSpec + Send + Sync + 'static, )

Register a named synchronous builder — a native menu, whose rows are a pure function of the open context. Re-registering a name overwrites the previous entry (last writer wins), matching PickerRegistry::register’s semantics.

Source

pub fn register_async( &self, name: impl Into<String>, builder: impl Fn(&TransientContext) -> TransientBuildFuture + Send + Sync + 'static, )

TR.2: register a named builder that answers a TransientBuildFuture — the guest-backed shape. The host parks on the future and seats the menu when it lands.

Source

pub fn unregister(&self, name: &str) -> bool

TR.2: drop the builder registered under name, reporting whether one was there. The teardown half of register_async — an unloaded plugin’s menu name must stop resolving, or Effect::OpenTransient would keep reaching a client whose actor is gone and report a host error instead of “unknown source”.

Source

pub fn build( &self, name: &str, ctx: &TransientContext, ) -> Option<TransientBuild>

Build the named transient for the place it was opened from, or None if no builder is registered under name.

MG.23h: ctx is supplied by the renderer at open time rather than by whatever emitted Effect::OpenTransient. That is what makes every path uniformly context-aware — the chord, the ex-command (whose ExCommandContext carries no buffer), and any future plugin-emitted open. Resolving it at emit time instead would leave all but the chord looking at nothing.

Source

pub fn build_ready( &self, name: &str, ctx: &TransientContext, ) -> Option<TransientSpec>

build for a caller that can only handle a synchronous answer — tests and native call sites that predate TR.2. A guest-backed name answers None here rather than blocking.

Trait Implementations§

Source§

impl Default for TransientSourceRegistry

Source§

fn default() -> TransientSourceRegistry

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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