pub struct LaunchInput<'a> { /* private fields */ }Expand description
What a launch handed the app: the arguments of its command line or of an “open with” (paths, URLs), the app’s own options it named, the file a host lent it, the content store where the app keeps what a launch hands it, and where playback of the media it names stood on the device or app that handed it over.
Implementations§
Source§impl<'a> LaunchInput<'a>
impl<'a> LaunchInput<'a>
Sourcepub fn new(arguments: &'a [String], file: Option<&'a OpenFile>) -> Self
pub fn new(arguments: &'a [String], file: Option<&'a OpenFile>) -> Self
A launch naming arguments and handing over file: what a host
asks ResourceApp::launch about, and
what a test of an app’s launch builds.
Sourcepub fn with_record(self, state: &'a dyn Any) -> Self
pub fn with_record(self, state: &'a dyn Any) -> Self
The same launch on a record that is already there, as it is now.
Sourcepub fn record<S: 'static>(&self) -> Option<&'a S>
pub fn record<S: 'static>(&self) -> Option<&'a S>
The state of the record the launch opened, as it is when the launch
is taken: S is the app resource’s state. None before the record
is open (a genesis) or for another
type.
Sourcepub fn with_content(self, content: Option<&'a ContentStore>) -> Self
pub fn with_content(self, content: Option<&'a ContentStore>) -> Self
The same launch on a host that lends the app content.
Sourcepub fn with_handoff(self, handoff: Option<&'a PlaybackHandoff>) -> Self
pub fn with_handoff(self, handoff: Option<&'a PlaybackHandoff>) -> Self
The same launch, continuing handoff’s playback.
Sourcepub fn with_options(self, options: &'a [LaunchOption]) -> Self
pub fn with_options(self, options: &'a [LaunchOption]) -> Self
This launch, also naming the app’s own options.
Sourcepub fn arguments(&self) -> &'a [String]
pub fn arguments(&self) -> &'a [String]
The launch’s arguments, in order; at most
ResourceApp::ARGUMENTS of them.
Sourcepub fn argument(&self) -> Option<&'a str>
pub fn argument(&self) -> Option<&'a str>
The first argument, for an app that takes one (a path, a URL).
Sourcepub fn file(&self) -> Option<&'a OpenFile>
pub fn file(&self) -> Option<&'a OpenFile>
The file a host handed over to open: its name, media type and bytes. Only a file of a type the app opens reaches it.
Sourcepub fn content(&self) -> Option<&'a ContentStore>
pub fn content(&self) -> Option<&'a ContentStore>
The content store of the host the app is launched in: a handed
file’s bytes are kept there, and the launch’s actions name them by
hash, so the record never carries a file and every device that holds
the bytes reads them. None where the host lends none.
Sourcepub fn handoff(&self) -> Option<&'a PlaybackHandoff>
pub fn handoff(&self) -> Option<&'a PlaybackHandoff>
Where playback of the media the launch names stood on the device or
app that handed it over: the position to continue from, whether it
keeps playing and what it was called there. None for an ordinary
launch, which starts at the beginning.
Sourcepub fn option(&self, name: &str) -> Option<&'a str>
pub fn option(&self, name: &str) -> Option<&'a str>
The value of the app’s option name (--purpose), when the launch
named it; see ResourceApp::OPTIONS.
Sourcepub fn flag(&self, name: &str) -> bool
pub fn flag(&self, name: &str) -> bool
Whether the launch named the app’s switch name; see
ResourceApp::FLAGS.
Trait Implementations§
Source§impl<'a> Clone for LaunchInput<'a>
impl<'a> Clone for LaunchInput<'a>
Source§fn clone(&self) -> LaunchInput<'a>
fn clone(&self) -> LaunchInput<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for LaunchInput<'a>
Auto Trait Implementations§
impl<'a> Freeze for LaunchInput<'a>
impl<'a> !RefUnwindSafe for LaunchInput<'a>
impl<'a> !Send for LaunchInput<'a>
impl<'a> !Sync for LaunchInput<'a>
impl<'a> Unpin for LaunchInput<'a>
impl<'a> UnsafeUnpin for LaunchInput<'a>
impl<'a> !UnwindSafe for LaunchInput<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> 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