Skip to main content

LaunchInput

Struct LaunchInput 

Source
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>

Source

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.

Source

pub fn with_record(self, state: &'a dyn Any) -> Self

The same launch on a record that is already there, as it is now.

Source

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.

Source

pub fn with_content(self, content: Option<&'a ContentStore>) -> Self

The same launch on a host that lends the app content.

Source

pub fn with_handoff(self, handoff: Option<&'a PlaybackHandoff>) -> Self

The same launch, continuing handoff’s playback.

Source

pub fn with_options(self, options: &'a [LaunchOption]) -> Self

This launch, also naming the app’s own options.

Source

pub fn arguments(&self) -> &'a [String]

The launch’s arguments, in order; at most ResourceApp::ARGUMENTS of them.

Source

pub fn argument(&self) -> Option<&'a str>

The first argument, for an app that takes one (a path, a URL).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Whether the launch named the app’s switch name; see ResourceApp::FLAGS.

Source

pub fn is_empty(&self) -> bool

Whether the launch named nothing: a plain start of the app.

Trait Implementations§

Source§

impl<'a> Clone for LaunchInput<'a>

Source§

fn clone(&self) -> LaunchInput<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

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> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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
§

impl<T> ErasedDestructor for T
where T: 'static,