Skip to main content

SharedItem

Struct SharedItem 

Source
pub struct SharedItem<T: WorkspaceItem> { /* private fields */ }
Expand description

Rc<RefCell<T>> adapter: registers shared item state — the ownership pattern the Python bindings use for FigureView — as a workspace item. id/title/closable are snapshotted at construction because RefCell borrows cannot escape the trait’s &self signatures; pane identity is treated as stable for the workspace’s lifetime.

Implementations§

Source§

impl<T: WorkspaceItem> SharedItem<T>

Source

pub fn new(inner: Rc<RefCell<T>>) -> Self

Snapshot the item’s identity and register the shared state.

Trait Implementations§

Source§

impl<T: WorkspaceItem> WorkspaceItem for SharedItem<T>

Source§

fn id(&self) -> &str

Stable identifier referenced by WorkspaceNode::Tabs::tabs.
Source§

fn title(&self) -> &str

Visible tab label.
Source§

fn closable(&self) -> bool

Whether the pane’s tab shows a close button.
Source§

fn update(&mut self, delta_ms: f32) -> Result<()>

Per-frame update. delta_ms is the frame time in milliseconds.
Source§

fn render(&mut self, ui: &mut Ui<'_>, rect: PixelRect) -> Result<()>

Render the item inside rect, clipped to the pane’s panel scope.
Source§

fn on_event(&mut self, event: &InputEvent) -> Result<()>

Pointer events are routed to the leaf under the cursor; key and text events are routed to the focused leaf (the last pane clicked).

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for SharedItem<T>

§

impl<T> !Send for SharedItem<T>

§

impl<T> !Sync for SharedItem<T>

§

impl<T> !UnwindSafe for SharedItem<T>

§

impl<T> Forget for SharedItem<T>

§

impl<T> Freeze for SharedItem<T>
where *const RcInner<RefCell<T>> is !null: Freeze, PhantomData<RcInner<RefCell<T>>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl<T> Move for SharedItem<T>

§

impl<T> Unpin for SharedItem<T>
where Rc<RefCell<T>>: Unpin, *const u8 is !null: Unpin,

§

impl<T> UnsafeUnpin for SharedItem<T>
where *const RcInner<RefCell<T>> is !null: UnsafeUnpin, PhantomData<RcInner<RefCell<T>>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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.