pub struct Fixture<R: Resource> { /* private fields */ }Expand description
The scene of one screenshot scenario that its actions cannot stage:
handed to ResourceApp::fixture before
the view is built.
Implementations§
Source§impl<R: Resource> Fixture<R>
impl<R: Resource> Fixture<R>
Sourcepub fn person(&self) -> &str
pub fn person(&self) -> &str
Who the capture’s window is for: the participant the view reads as
its own (RecordEnv::me). A scene that holds
something of the person’s own — a seat at the table, an issue
assigned to them — stages it for them.
Sourcepub fn provide<T: 'static>(&mut self, value: T)
pub fn provide<T: 'static>(&mut self, value: T)
Stand value in for a live source: the views and surfaces of this
capture read it with cx.fixture::<T>(). One value per type; a
second replaces the first.
Sourcepub fn answer(&mut self, target: &RemoteActionTarget, value: &impl Serialize)
pub fn answer(&mut self, target: &RemoteActionTarget, value: &impl Serialize)
Stand value in for what another provider’s action at target
answers: a view’s RecordEnv::query of
it reads value, as the action’s result, in this capture.
Sourcepub fn directory(&mut self) -> Result<&Path>
pub fn directory(&mut self) -> Result<&Path>
A private scratch directory for files the scene shows (a folder to browse, a repository to diff), removed after the capture.
Sourcepub fn content(&mut self) -> &ContentStore
pub fn content(&mut self) -> &ContentStore
The content store the capture’s views read from
(RecordEnv::content), for the blobs a scene
shows: photos, attachments, thumbnails. A private one when the host
lent none.
Sourcepub fn start(&mut self, state: R::State)where
R::State: Fields,
pub fn start(&mut self, state: R::State)where
R::State: Fields,
What the record holds when the capture starts: state, written into
it directly as the record’s first content, before the versions. For
a scene whose starting content no single action makes as it stands
(items under fixed ids the scenario names, written by several
people) in fields the record keeps to its own actions
(#[model(readonly)]), which refuse every generic edit, a
scenario’s or a version’s alike. It is nobody’s change: committed as
the record’s genesis and checked by no door, so only ever a
capture’s.
Sourcepub fn version(&mut self, author: &str, at_ms: i64, invoke: Invoke<R>)
pub fn version(&mut self, author: &str, at_ms: i64, invoke: Invoke<R>)
A version of the resource author wrote at at_ms (milliseconds
since the Unix epoch), before the capture: it arrives as their
change does over sync, attributed to them in history and on no one’s
undo stack here. Versions are written in the order given, before the
scenario’s own actions.
Sourcepub fn collaborator(&mut self, name: &str, at: ResourceSelection)
pub fn collaborator(&mut self, name: &str, at: ResourceSelection)
A collaborator named name, shown where they are in the resource
(a selected item, a caret) the way their presence arrives in a
shared window.
Auto Trait Implementations§
impl<R> Freeze for Fixture<R>
impl<R> !RefUnwindSafe for Fixture<R>
impl<R> !Send for Fixture<R>
impl<R> !Sync for Fixture<R>
impl<R> Unpin for Fixture<R>
impl<R> UnsafeUnpin for Fixture<R>
impl<R> !UnwindSafe for Fixture<R>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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