Skip to main content

PublishedObject

Struct PublishedObject 

Source
pub struct PublishedObject<T: WipObject> { /* private fields */ }
Expand description

A host-private object instance combined with an explicit ordered interface set.

The instance is owned by this value and can therefore be request-scoped. No global object registry is required. Worldspace paths remain provider context and are deliberately absent from the publication.

Implementations§

Source§

impl<T: WipObject> PublishedObject<T>

Source

pub fn new(implementation: T) -> Self

Starts a publication with no exposed interfaces.

Source

pub fn bind_scope(self, current: ScopeObservation) -> Self

Attaches a current scope snapshot inside the provider’s atomic boundary.

Never populate this from a stale prelookup. Target, scope association, Descriptor and backend handles must remain coherent through dispatch and commit. A later same-path binding replaces the earlier snapshot.

Source

pub fn expose<D>( self, interface: &RegisteredInterface<D>, ) -> Result<Self, PublicationError>

Explicitly exposes a registered generated interface in insertion order.

The InterfaceImplementation<T> bound is generated only when T implements the corresponding Rust interface trait. Duplicate scoped references are rejected.

Source

pub fn project( self, interfaces: &[InterfaceRef], visible: impl Fn(&InterfaceRef, &str) -> bool, ) -> Result<Self, PublicationError>

Restricts a publication to an ordered interface/operation view.

This never adds implementations or changes codecs. The provider must use the identical operation predicate for fetch_interface, and keep the effective view stable for the lifetime of its references. Filtered descriptors are scoped to that view, not mutations of registry artifacts.

Source

pub fn implementation(&self) -> &T

Returns the host-private implementation without projecting its fields.

Source

pub fn protocol_object(&self) -> Object

Builds metadata from the explicit exposure set in insertion order.

This path-free projection is useful while composing a publication, but is not proof that its scopes are currently published. Use ObjectProvider::observe_object for a validated current observation, or Self::protocol_object_at inside a provider’s coherent boundary. The metadata contains no path, children, descriptor, backend handle, credential, or provider resolution state.

Source

pub fn protocol_object_at(&self, path: &str) -> Result<Object, CallError>

Validates a current Object observation inside the provider’s boundary.

All exposed interfaces must have compatible, live scope associations. The provider must still establish those associations atomically; this method cannot verify backend lifetime assertions or lock external writers.

Source

pub fn into_inner(self) -> T

Consumes the publication and returns its host-private implementation.

Auto Trait Implementations§

§

impl<T> Freeze for PublishedObject<T>
where T: Freeze, Vec<BoundInterface<T>>: Freeze,

§

impl<T> RefUnwindSafe for PublishedObject<T>
where T: RefUnwindSafe, Vec<BoundInterface<T>>: RefUnwindSafe,

§

impl<T> Send for PublishedObject<T>
where T: Send, Vec<BoundInterface<T>>: Send,

§

impl<T> Sync for PublishedObject<T>
where T: Sync, Vec<BoundInterface<T>>: Sync,

§

impl<T> Unpin for PublishedObject<T>
where T: Unpin, Vec<BoundInterface<T>>: Unpin,

§

impl<T> UnsafeUnpin for PublishedObject<T>
where T: UnsafeUnpin, Vec<BoundInterface<T>>: UnsafeUnpin,

§

impl<T> UnwindSafe for PublishedObject<T>
where T: UnwindSafe, Vec<BoundInterface<T>>: UnwindSafe,

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, 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.