Struct ashpd::desktop::print::Settings

source ·
pub struct Settings {
Show 28 fields pub orientation: Option<Orientation>, pub paper_format: Option<String>, pub paper_width: Option<String>, pub paper_height: Option<String>, pub n_copies: Option<String>, pub default_source: Option<String>, pub quality: Option<Quality>, pub resolution: Option<String>, pub use_color: Option<bool>, pub duplex: Option<String>, pub collate: Option<String>, pub reverse: Option<String>, pub media_type: Option<String>, pub dither: Option<String>, pub scale: Option<String>, pub print_pages: Option<String>, pub page_ranges: Option<String>, pub page_set: Option<String>, pub finishings: Option<String>, pub number_up: Option<String>, pub number_up_layout: Option<String>, pub output_bin: Option<String>, pub resolution_x: Option<String>, pub resolution_y: Option<String>, pub print_lpi: Option<String>, pub output_basename: Option<String>, pub output_file_format: Option<String>, pub output_uri: Option<Url>,
}
Expand description

Print settings to set in the print dialog.

Fields§

§orientation: Option<Orientation>

One of landscape, portrait, reverse_landscape or reverse_portrait.

§paper_format: Option<String>

A paper name according to PWG 5101.1-2002

§paper_width: Option<String>

Paper width, in millimeters.

§paper_height: Option<String>

Paper height, in millimeters.

§n_copies: Option<String>

The number of copies to print.

§default_source: Option<String>

The default paper source.

§quality: Option<Quality>

Print quality.

§resolution: Option<String>

The resolution, sets both resolution-x & resolution-y

§use_color: Option<bool>

Whether to use color.

§duplex: Option<String>

Duplex printing mode, one of simplex, horizontal or vertical.

§collate: Option<String>

Whether to collate copies.

§reverse: Option<String>

Whether to reverse the order of printed pages.

§media_type: Option<String>

A media type according to PWG 5101.1-2002

§dither: Option<String>

The dithering to use, one of fine, none, coarse, lineart, grayscale or error-diffusion.

§scale: Option<String>

The scale in percent

§print_pages: Option<String>

What pages to print, one of all, selection, current or ranges.

§page_ranges: Option<String>

A list of page ranges, formatted like this: 0-2,4,9-11.

§page_set: Option<String>

What pages to print, one of all, even or odd.

§finishings: Option<String>

The finishings.

§number_up: Option<String>

The number of pages per sheet.

§number_up_layout: Option<String>

One of lrtb, lrbt, rltb, rlbt, tblr, tbrl, btlr, btrl.

§output_bin: Option<String>

The output bin.

§resolution_x: Option<String>

The horizontal resolution in dpi.

§resolution_y: Option<String>

The vertical resolution in dpi.

§print_lpi: Option<String>

The resolution in lpi (lines per inch).

§output_basename: Option<String>

Basename to use for print-to-file.

§output_file_format: Option<String>

Format to use for print-to-file, one of PDF, PS, SVG

§output_uri: Option<Url>

The uri used for print-to file.

Implementations§

source§

impl Settings

source

pub fn orientation(self, orientation: impl Into<Option<Orientation>>) -> Self

Sets the orientation.

source

pub fn paper_format<'a>(self, paper_format: impl Into<Option<&'a str>>) -> Self

Sets the paper name.

source

pub fn paper_width<'a>(self, paper_width: impl Into<Option<&'a str>>) -> Self

Sets the paper width.

source

pub fn paper_height<'a>(self, paper_height: impl Into<Option<&'a str>>) -> Self

Sets the paper height.

source

pub fn n_copies<'a>(self, n_copies: impl Into<Option<&'a str>>) -> Self

Sets the number of copies to print.

source

pub fn default_source<'a>( self, default_source: impl Into<Option<&'a str>> ) -> Self

Sets the default paper source.

source

pub fn quality(self, quality: impl Into<Option<Quality>>) -> Self

Sets the print quality.

source

pub fn resolution<'a>(self, resolution: impl Into<Option<&'a str>>) -> Self

Sets the resolution, both resolution-x & resolution-y.

source

pub fn use_color(self, use_color: impl Into<Option<bool>>) -> Self

Sets whether to use color.

source

pub fn duplex<'a>(self, duplex: impl Into<Option<&'a str>>) -> Self

Sets the duplex printing mode.

source

pub fn collate<'a>(self, collate: impl Into<Option<&'a str>>) -> Self

Whether to collate copies.

source

pub fn reverse<'a>(self, reverse: impl Into<Option<&'a str>>) -> Self

Sets whether to reverse the order of the printed pages.

source

pub fn media_type<'a>(self, media_type: impl Into<Option<&'a str>>) -> Self

Sets the media type.

source

pub fn dither<'a>(self, dither: impl Into<Option<&'a str>>) -> Self

Sets the dithering to use.

source

pub fn scale<'a>(self, scale: impl Into<Option<&'a str>>) -> Self

Sets the page scale in percent.

source

pub fn print_pages<'a>(self, print_pages: impl Into<Option<&'a str>>) -> Self

Sets what pages to print, one of all, selection, current or ranges.

source

pub fn page_ranges<'a>(self, page_ranges: impl Into<Option<&'a str>>) -> Self

Sets a list of page ranges, formatted like this: 0-2,4,9-11.

source

pub fn page_set<'a>(self, page_set: impl Into<Option<&'a str>>) -> Self

Sets what pages to print, one of all, even or odd.

source

pub fn finishings<'a>(self, finishings: impl Into<Option<&'a str>>) -> Self

Sets the finishings.

source

pub fn number_up<'a>(self, number_up: impl Into<Option<&'a str>>) -> Self

Sets the number of pages per sheet.

source

pub fn number_up_layout<'a>( self, number_up_layout: impl Into<Option<&'a str>> ) -> Self

Sets the number up layout, one of lrtb, lrbt, rltb, rlbt, tblr, tbrl, btlr, btrl.

source

pub fn output_bin<'a>(self, output_bin: impl Into<Option<&'a str>>) -> Self

Sets the output bin

source

pub fn resolution_x<'a>(self, resolution_x: impl Into<Option<&'a str>>) -> Self

Sets the horizontal resolution in dpi.

source

pub fn resolution_y<'a>(self, resolution_y: impl Into<Option<&'a str>>) -> Self

Sets the vertical resolution in dpi.

source

pub fn print_lpi<'a>(self, print_lpi: impl Into<Option<&'a str>>) -> Self

Sets the resolution in lines per inch.

source

pub fn output_basename<'a>( self, output_basename: impl Into<Option<&'a str>> ) -> Self

Sets the print-to-file base name.

source

pub fn output_file_format<'a>( self, output_file_format: impl Into<Option<&'a str>> ) -> Self

Sets the print-to-file format, one of PS, PDF, SVG.

source

pub fn output_uri<'a>(self, output_uri: impl Into<Option<&'a Url>>) -> Self

Sets the print-to-file output uri.

Trait Implementations§

source§

impl Debug for Settings

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Settings

source§

fn default() -> Settings

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Settings

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Settings

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Type for Settings

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more

Auto Trait Implementations§

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
§

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

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<'de, T> DynamicDeserialize<'de> for T
where T: Type + Deserialize<'de> + ?Sized,

§

type Deserializer = PhantomData<T>

A DeserializeSeed implementation for this type.
source§

fn deserializer_for_signature<S>( signature: S ) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error>
where S: TryInto<Signature<'de>>, <S as TryInto<Signature<'de>>>::Error: Into<Error>,

Get a deserializer compatible with this signature.
source§

impl<T> DynamicType for T
where T: Type + ?Sized,

source§

fn dynamic_signature(&self) -> Signature<'_>

Get the signature for the implementing type. Read more
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> NoneValue for T
where T: Default,

§

type NoneType = T

source§

fn null_value() -> T

The none-equivalent value.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,