Struct CoordinateFormat

Source
pub struct CoordinateFormat {
    pub integer: u8,
    pub decimal: u8,
}
Expand description

The coordinate format specifies the number of integer and decimal places in a coordinate number. For example, the 24 format specifies 2 integer and 4 decimal places. The number of decimal places must be 4, 5 or 6. The number of integer places must be not more than 6. Thus the longest representable coordinate number is nnnnnn.nnnnnn.

Fields§

§integer: u8§decimal: u8

Implementations§

Source§

impl CoordinateFormat

Source

pub fn new(integer: u8, decimal: u8) -> Self

Examples found in repository?
examples/two-boxes.rs (line 14)
13fn main() {
14    let cf = CoordinateFormat::new(2, 5);
15    let commands: Vec<Command> = vec![
16        FunctionCode::GCode(GCode::Comment("Ucamco ex. 1: Two square boxes".to_string())).into(),
17        ExtendedCode::CoordinateFormat(cf).into(),
18        ExtendedCode::Unit(Unit::Millimeters).into(),
19        ExtendedCode::FileAttribute(FileAttribute::GenerationSoftware(GenerationSoftware::new(
20            "Rust Gerber",
21            "gerber-types-rs",
22            Some(VERSION),
23        )))
24        .into(),
25        ExtendedCode::FileAttribute(FileAttribute::Part(Part::Other(
26            "Only an example".to_string(),
27        )))
28        .into(),
29        ExtendedCode::LoadPolarity(Polarity::Dark).into(),
30        ExtendedCode::ApertureDefinition(ApertureDefinition {
31            code: 10,
32            aperture: Aperture::Circle(Circle {
33                diameter: 0.01,
34                hole_diameter: None,
35            }),
36        })
37        .into(),
38        FunctionCode::DCode(DCode::SelectAperture(10)).into(),
39        FunctionCode::DCode(DCode::Operation(Operation::Move(Coordinates::new(
40            0, 0, cf,
41        ))))
42        .into(),
43        FunctionCode::GCode(GCode::InterpolationMode(InterpolationMode::Linear)).into(),
44        // TODO: The interpolate representation needs to take the coordinate
45        // format into account!
46        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
47            Coordinates::new(5, 0, cf),
48            None,
49        )))
50        .into(),
51        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
52            Coordinates::at_y(5, cf),
53            None,
54        )))
55        .into(),
56        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
57            Coordinates::at_x(0, cf),
58            None,
59        )))
60        .into(),
61        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
62            Coordinates::at_y(0, cf),
63            None,
64        )))
65        .into(),
66        FunctionCode::DCode(DCode::Operation(Operation::Move(Coordinates::at_x(6, cf)))).into(),
67        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
68            Coordinates::at_x(11, cf),
69            None,
70        )))
71        .into(),
72        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
73            Coordinates::at_y(5, cf),
74            None,
75        )))
76        .into(),
77        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
78            Coordinates::at_x(6, cf),
79            None,
80        )))
81        .into(),
82        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
83            Coordinates::at_y(0, cf),
84            None,
85        )))
86        .into(),
87        FunctionCode::MCode(MCode::EndOfFile).into(),
88    ];
89    let mut stdout = stdout();
90    commands.serialize(&mut stdout).unwrap();
91}
More examples
Hide additional examples
examples/polarities-apertures.rs (line 11)
10fn main() {
11    let cf = CoordinateFormat::new(2, 6);
12    let commands: Vec<Command> = vec![
13        FunctionCode::GCode(GCode::Comment("Ucamco ex. 2: Shapes".to_string())).into(),
14        ExtendedCode::CoordinateFormat(cf).into(),
15        ExtendedCode::Unit(Unit::Inches).into(),
16        ExtendedCode::FileAttribute(FileAttribute::GenerationSoftware(GenerationSoftware::new(
17            "Rust Gerber",
18            "gerber-types-rs",
19            Some(VERSION),
20        )))
21        .into(),
22        ExtendedCode::FileAttribute(FileAttribute::Part(Part::Other(
23            "Only an example".to_string(),
24        )))
25        .into(),
26        ExtendedCode::LoadPolarity(Polarity::Dark).into(),
27        FunctionCode::GCode(GCode::Comment("Define Apertures".to_string())).into(),
28        ExtendedCode::ApertureMacro(ApertureMacro::new("TARGET125").add_content(MoirePrimitive {
29            center: (0.0.into(), 0.0.into()),
30            diameter: 0.125.into(),
31            ring_thickness: 0.01.into(),
32            gap: 0.01.into(),
33            max_rings: 3,
34            cross_hair_thickness: 0.003.into(),
35            cross_hair_length: 0.150.into(),
36            angle: 0.0.into(),
37        }))
38        .into(),
39        ExtendedCode::ApertureMacro(ApertureMacro::new("THERMAL80").add_content(
40            ThermalPrimitive {
41                center: (0.0.into(), 0.0.into()),
42                outer_diameter: 0.08.into(),
43                inner_diameter: 0.055.into(),
44                gap: 0.0125.into(),
45                angle: 45.0.into(),
46            },
47        ))
48        .into(),
49        ExtendedCode::ApertureDefinition(ApertureDefinition {
50            code: 10,
51            aperture: Aperture::Circle(Circle {
52                diameter: 0.01,
53                hole_diameter: None,
54            }),
55        })
56        .into(),
57        ExtendedCode::ApertureDefinition(ApertureDefinition {
58            code: 11,
59            aperture: Aperture::Circle(Circle {
60                diameter: 0.06,
61                hole_diameter: None,
62            }),
63        })
64        .into(),
65        ExtendedCode::ApertureDefinition(ApertureDefinition {
66            code: 12,
67            aperture: Aperture::Rectangle(Rectangular {
68                x: 0.06,
69                y: 0.06,
70                hole_diameter: None,
71            }),
72        })
73        .into(),
74        ExtendedCode::ApertureDefinition(ApertureDefinition {
75            code: 13,
76            aperture: Aperture::Rectangle(Rectangular {
77                x: 0.04,
78                y: 0.1,
79                hole_diameter: None,
80            }),
81        })
82        .into(),
83        ExtendedCode::ApertureDefinition(ApertureDefinition {
84            code: 14,
85            aperture: Aperture::Rectangle(Rectangular {
86                x: 0.1,
87                y: 0.04,
88                hole_diameter: None,
89            }),
90        })
91        .into(),
92        ExtendedCode::ApertureDefinition(ApertureDefinition {
93            code: 15,
94            aperture: Aperture::Obround(Rectangular {
95                x: 0.04,
96                y: 0.1,
97                hole_diameter: None,
98            }),
99        })
100        .into(),
101        ExtendedCode::ApertureDefinition(ApertureDefinition {
102            code: 16,
103            aperture: Aperture::Polygon(Polygon {
104                diameter: 0.1,
105                vertices: 3,
106                rotation: None,
107                hole_diameter: None,
108            }),
109        })
110        .into(),
111        ExtendedCode::ApertureDefinition(ApertureDefinition {
112            code: 18,
113            aperture: Aperture::Other("TARGET125".to_string()),
114        })
115        .into(),
116        ExtendedCode::ApertureDefinition(ApertureDefinition {
117            code: 19,
118            aperture: Aperture::Other("THERMAL80".to_string()),
119        })
120        .into(),
121        FunctionCode::GCode(GCode::Comment("Start image generation".to_string())).into(),
122        FunctionCode::DCode(DCode::SelectAperture(10)).into(),
123        FunctionCode::DCode(DCode::Operation(Operation::Move(Coordinates::new(
124            0,
125            CoordinateNumber::try_from(0.25).unwrap(),
126            cf,
127        ))))
128        .into(),
129        FunctionCode::GCode(GCode::InterpolationMode(InterpolationMode::Linear)).into(),
130        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
131            Coordinates::new(0, 0, cf),
132            None,
133        )))
134        .into(),
135        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
136            Coordinates::new(CoordinateNumber::try_from(0.25).unwrap(), 0, cf),
137            None,
138        )))
139        .into(),
140        FunctionCode::DCode(DCode::Operation(Operation::Move(Coordinates::new(
141            1, 1, cf,
142        ))))
143        .into(),
144        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
145            Coordinates::at_x(CoordinateNumber::try_from(1.5).unwrap(), cf),
146            None,
147        )))
148        .into(),
149        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
150            Coordinates::new(2, CoordinateNumber::try_from(1.5).unwrap(), cf),
151            None,
152        )))
153        .into(),
154        FunctionCode::DCode(DCode::Operation(Operation::Move(Coordinates::at_x(
155            CoordinateNumber::try_from(2.5).unwrap(),
156            cf,
157        ))))
158        .into(),
159        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
160            Coordinates::at_y(1, cf),
161            None,
162        )))
163        .into(),
164        FunctionCode::DCode(DCode::SelectAperture(11)).into(),
165        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
166            1, 1, cf,
167        ))))
168        .into(),
169        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
170            2, 1, cf,
171        ))))
172        .into(),
173        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
174            CoordinateNumber::try_from(2.5).unwrap(),
175            1,
176            cf,
177        ))))
178        .into(),
179        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
180            CoordinateNumber::try_from(2.5).unwrap(),
181            CoordinateNumber::try_from(1.5).unwrap(),
182            cf,
183        ))))
184        .into(),
185        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
186            2,
187            CoordinateNumber::try_from(1.5).unwrap(),
188            cf,
189        ))))
190        .into(),
191        FunctionCode::DCode(DCode::SelectAperture(12)).into(),
192        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
193            1,
194            CoordinateNumber::try_from(1.5).unwrap(),
195            cf,
196        ))))
197        .into(),
198        FunctionCode::DCode(DCode::SelectAperture(13)).into(),
199        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
200            3,
201            CoordinateNumber::try_from(1.5).unwrap(),
202            cf,
203        ))))
204        .into(),
205        FunctionCode::DCode(DCode::SelectAperture(14)).into(),
206        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
207            3,
208            CoordinateNumber::try_from(1.25).unwrap(),
209            cf,
210        ))))
211        .into(),
212        FunctionCode::DCode(DCode::SelectAperture(15)).into(),
213        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
214            3, 1, cf,
215        ))))
216        .into(),
217        FunctionCode::DCode(DCode::SelectAperture(10)).into(),
218        FunctionCode::DCode(DCode::Operation(Operation::Move(Coordinates::new(
219            CoordinateNumber::try_from(3.75).unwrap(),
220            1,
221            cf,
222        ))))
223        .into(),
224        FunctionCode::GCode(GCode::QuadrantMode(QuadrantMode::Multi)).into(),
225        FunctionCode::GCode(GCode::InterpolationMode(
226            InterpolationMode::CounterclockwiseCircular,
227        ))
228        .into(),
229        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
230            Coordinates::new(CoordinateNumber::try_from(3.75).unwrap(), 1, cf),
231            Some(CoordinateOffset::new(
232                CoordinateNumber::try_from(0.25).unwrap(),
233                0,
234                cf,
235            )),
236        )))
237        .into(),
238        FunctionCode::DCode(DCode::SelectAperture(16)).into(),
239        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
240            CoordinateNumber::try_from(3.4).unwrap(),
241            1,
242            cf,
243        ))))
244        .into(),
245        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
246            CoordinateNumber::try_from(3.5).unwrap(),
247            CoordinateNumber::try_from(0.9).unwrap(),
248            cf,
249        ))))
250        .into(),
251        FunctionCode::DCode(DCode::SelectAperture(10)).into(),
252        FunctionCode::GCode(GCode::RegionMode(true)).into(),
253        FunctionCode::DCode(DCode::Operation(Operation::Move(Coordinates::new(
254            CoordinateNumber::try_from(0.5).unwrap(),
255            2,
256            cf,
257        ))))
258        .into(),
259        FunctionCode::GCode(GCode::InterpolationMode(InterpolationMode::Linear)).into(),
260        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
261            Coordinates::at_y(CoordinateNumber::try_from(3.75).unwrap(), cf),
262            None,
263        )))
264        .into(),
265        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
266            Coordinates::at_x(CoordinateNumber::try_from(3.75).unwrap(), cf),
267            None,
268        )))
269        .into(),
270        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
271            Coordinates::at_y(2, cf),
272            None,
273        )))
274        .into(),
275        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
276            Coordinates::at_x(CoordinateNumber::try_from(0.5).unwrap(), cf),
277            None,
278        )))
279        .into(),
280        FunctionCode::GCode(GCode::RegionMode(false)).into(),
281        FunctionCode::DCode(DCode::SelectAperture(18)).into(),
282        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
283            0,
284            CoordinateNumber::try_from(3.875).unwrap(),
285            cf,
286        ))))
287        .into(),
288        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
289            CoordinateNumber::try_from(3.875).unwrap(),
290            CoordinateNumber::try_from(3.875).unwrap(),
291            cf,
292        ))))
293        .into(),
294        ExtendedCode::LoadPolarity(Polarity::Clear).into(),
295        FunctionCode::GCode(GCode::RegionMode(true)).into(),
296        FunctionCode::DCode(DCode::Operation(Operation::Move(Coordinates::new(
297            1,
298            CoordinateNumber::try_from(2.5).unwrap(),
299            cf,
300        ))))
301        .into(),
302        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
303            Coordinates::at_y(3, cf),
304            None,
305        )))
306        .into(),
307        FunctionCode::GCode(GCode::QuadrantMode(QuadrantMode::Single)).into(),
308        FunctionCode::GCode(GCode::InterpolationMode(
309            InterpolationMode::ClockwiseCircular,
310        ))
311        .into(),
312        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
313            Coordinates::new(
314                CoordinateNumber::try_from(1.25).unwrap(),
315                CoordinateNumber::try_from(3.25).unwrap(),
316                cf,
317            ),
318            Some(CoordinateOffset::new(
319                CoordinateNumber::try_from(0.25).unwrap(),
320                0,
321                cf,
322            )),
323        )))
324        .into(),
325        FunctionCode::GCode(GCode::InterpolationMode(InterpolationMode::Linear)).into(),
326        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
327            Coordinates::at_x(3, cf),
328            None,
329        )))
330        .into(),
331        FunctionCode::GCode(GCode::QuadrantMode(QuadrantMode::Multi)).into(),
332        FunctionCode::GCode(GCode::InterpolationMode(
333            InterpolationMode::ClockwiseCircular,
334        ))
335        .into(),
336        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
337            Coordinates::new(3, CoordinateNumber::try_from(2.5).unwrap(), cf),
338            Some(CoordinateOffset::new(
339                0,
340                CoordinateNumber::try_from(0.375).unwrap(),
341                cf,
342            )),
343        )))
344        .into(),
345        FunctionCode::GCode(GCode::InterpolationMode(InterpolationMode::Linear)).into(),
346        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
347            Coordinates::at_x(1, cf),
348            None,
349        )))
350        .into(),
351        FunctionCode::GCode(GCode::RegionMode(false)).into(),
352        ExtendedCode::LoadPolarity(Polarity::Dark).into(),
353        FunctionCode::DCode(DCode::SelectAperture(10)).into(),
354        FunctionCode::DCode(DCode::Operation(Operation::Move(Coordinates::new(
355            CoordinateNumber::try_from(1.5).unwrap(),
356            CoordinateNumber::try_from(2.875).unwrap(),
357            cf,
358        ))))
359        .into(),
360        FunctionCode::DCode(DCode::Operation(Operation::Interpolate(
361            Coordinates::at_x(2, cf),
362            None,
363        )))
364        .into(),
365        FunctionCode::DCode(DCode::SelectAperture(11)).into(),
366        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
367            CoordinateNumber::try_from(1.5).unwrap(),
368            CoordinateNumber::try_from(2.875).unwrap(),
369            cf,
370        ))))
371        .into(),
372        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::at_x(2, cf)))).into(),
373        FunctionCode::DCode(DCode::SelectAperture(19)).into(),
374        FunctionCode::DCode(DCode::Operation(Operation::Flash(Coordinates::new(
375            CoordinateNumber::try_from(2.875).unwrap(),
376            CoordinateNumber::try_from(2.875).unwrap(),
377            cf,
378        ))))
379        .into(),
380        ExtendedCode::FileAttribute(FileAttribute::Md5(
381            "6ab9e892830469cdff7e3e346331d404".to_string(),
382        ))
383        .into(),
384        FunctionCode::MCode(MCode::EndOfFile).into(),
385    ];
386    let mut stdout = stdout();
387    commands.serialize(&mut stdout).unwrap();
388}

Trait Implementations§

Source§

impl Clone for CoordinateFormat

Source§

fn clone(&self) -> CoordinateFormat

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CoordinateFormat

Source§

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

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

impl From<CoordinateFormat> for Command

Source§

fn from(val: CoordinateFormat) -> Self

Converts to this type from the input type.
Source§

impl From<CoordinateFormat> for ExtendedCode

Source§

fn from(val: CoordinateFormat) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for CoordinateFormat

Source§

fn eq(&self, other: &CoordinateFormat) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for CoordinateFormat

Source§

impl Eq for CoordinateFormat

Source§

impl StructuralPartialEq for CoordinateFormat

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<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
Source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

Source§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
Source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
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
Source§

impl<T, Dst> ConvAsUtil<Dst> for T

Source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
Source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
Source§

impl<T> ConvUtil for T

Source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
Source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
Source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
Source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
Source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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<Src> TryFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
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<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

Source§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
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.
Source§

impl<Src> ValueFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
Source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

Source§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.