Skip to main content

Fixed

Struct Fixed 

Source
pub struct Fixed(/* private fields */);
Expand description

A signed 24.8 fixed-point number used in the wayland protocol.

This is a signed decimal type which offers a sign bit, 23 bits of integer precision and 8 bits of decimal precision.

§Arithmetic operations

This type implements all of the usual arithmetic operations for numbers. On overflow, they behave like the standard library operations except that multiplication and division always use wrapping semantics.

Implementations§

Source§

impl Fixed

Source

pub const MAX: Self

The largest Fixed.

Source

pub const MIN: Self

The smallest Fixed.

Source

pub const ZERO: Self

The 0 Fixed.

Source

pub const ONE: Self

The 1 Fixed.

Source

pub const TWO: Self

The 2 Fixed.

Source

pub const EPSILON: Self

The smallest positive Fixed.

Source

pub const NEGATIVE_EPSILON: Self

The largest negative Fixed.

Source

pub const fn from_wire(val: i32) -> Self

Creates a Fixed from the raw bits that appear in the wire protocol.

Examples found in repository?
examples/get-registry/../common/protocols/tablet_v2/zwp_tablet_pad_ring_v2.rs (line 370)
348    unsafe fn handle_event(
349        &self,
350        queue: &Queue,
351        data: *mut u8,
352        slf: &UntypedBorrowedProxy,
353        opcode: u32,
354        args: *mut wl_argument,
355    ) {
356        // SAFETY: This function requires that slf has the interface INTERFACE
357        let slf = unsafe { proxy::low_level::from_untyped_borrowed::<ZwpTabletPadRingV2Ref>(slf) };
358        match opcode {
359            0 => {
360                // SAFETY: INTERFACE requires that there are 1 arguments
361                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
362                // SAFETY: - INTERFACE requires that args[0] contains a uint
363                let arg0 = unsafe { ZwpTabletPadRingV2Source(args[0].u) };
364                self.0.source(slf, arg0);
365            }
366            1 => {
367                // SAFETY: INTERFACE requires that there are 1 arguments
368                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
369                // SAFETY: - INTERFACE requires that args[0] contains a fixed
370                let arg0 = unsafe { Fixed::from_wire(args[0].f) };
371                self.0.angle(slf, arg0);
372            }
373            2 => {
374                self.0.stop(slf);
375            }
376            3 => {
377                // SAFETY: INTERFACE requires that there are 1 arguments
378                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
379                // SAFETY: - INTERFACE requires that args[0] contains a uint
380                let arg0 = unsafe { args[0].u };
381                self.0.frame(slf, arg0);
382            }
383            _ => {
384                invalid_opcode("zwp_tablet_pad_ring_v2", opcode);
385            }
386        }
387    }
More examples
Hide additional examples
examples/get-registry/../common/protocols_data/tablet_v2/zwp_tablet_pad_ring_v2.rs (line 391)
365    unsafe fn handle_event(
366        &self,
367        queue: &Queue,
368        data: *mut u8,
369        slf: &UntypedBorrowedProxy,
370        opcode: u32,
371        args: *mut wl_argument,
372    ) {
373        // SAFETY: This function requires that slf has the interface INTERFACE
374        let slf = unsafe { proxy::low_level::from_untyped_borrowed::<ZwpTabletPadRingV2Ref>(slf) };
375        // SAFETY: This function requires that data is `&mut T` where `T`
376        //         has the type id returned by `Self::mutable_type`, i.e.,
377        //         `T = H::Data`.
378        let data: &mut H::Data = unsafe { &mut *data.cast() };
379        match opcode {
380            0 => {
381                // SAFETY: INTERFACE requires that there are 1 arguments
382                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
383                // SAFETY: - INTERFACE requires that args[0] contains a uint
384                let arg0 = unsafe { ZwpTabletPadRingV2Source(args[0].u) };
385                self.0.source(data, slf, arg0);
386            }
387            1 => {
388                // SAFETY: INTERFACE requires that there are 1 arguments
389                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
390                // SAFETY: - INTERFACE requires that args[0] contains a fixed
391                let arg0 = unsafe { Fixed::from_wire(args[0].f) };
392                self.0.angle(data, slf, arg0);
393            }
394            2 => {
395                self.0.stop(data, slf);
396            }
397            3 => {
398                // SAFETY: INTERFACE requires that there are 1 arguments
399                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
400                // SAFETY: - INTERFACE requires that args[0] contains a uint
401                let arg0 = unsafe { args[0].u };
402                self.0.frame(data, slf, arg0);
403            }
404            _ => {
405                invalid_opcode("zwp_tablet_pad_ring_v2", opcode);
406            }
407        }
408    }
examples/get-registry/../common/protocols/wayland/wl_touch.rs (line 456)
423    unsafe fn handle_event(
424        &self,
425        queue: &Queue,
426        data: *mut u8,
427        slf: &UntypedBorrowedProxy,
428        opcode: u32,
429        args: *mut wl_argument,
430    ) {
431        // SAFETY: This function requires that slf has the interface INTERFACE
432        let slf = unsafe { proxy::low_level::from_untyped_borrowed::<WlTouchRef>(slf) };
433        match opcode {
434            0 => {
435                // SAFETY: INTERFACE requires that there are 6 arguments
436                let args = unsafe { &*args.cast::<[wl_argument; 6]>() };
437                // SAFETY: - INTERFACE requires that args[0] contains a uint
438                let arg0 = unsafe { args[0].u };
439                // SAFETY: - INTERFACE requires that args[1] contains a uint
440                let arg1 = unsafe { args[1].u };
441                // SAFETY: - INTERFACE requires that args[2] contains an object
442                let arg2 = unsafe {
443                    if let Some(p) = NonNull::new(args[2].o.cast()) {
444                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
445                    } else {
446                        None
447                    }
448                };
449                // SAFETY: - INTERFACE requires that the object has the interface WlSurface::WL_INTERFACE
450                let arg2 = arg2.as_ref().map(|arg2| unsafe {
451                    proxy::low_level::from_untyped_borrowed::<WlSurfaceRef>(arg2)
452                });
453                // SAFETY: - INTERFACE requires that args[3] contains an int
454                let arg3 = unsafe { args[3].i };
455                // SAFETY: - INTERFACE requires that args[4] contains a fixed
456                let arg4 = unsafe { Fixed::from_wire(args[4].f) };
457                // SAFETY: - INTERFACE requires that args[5] contains a fixed
458                let arg5 = unsafe { Fixed::from_wire(args[5].f) };
459                self.0.down(slf, arg0, arg1, arg2, arg3, arg4, arg5);
460            }
461            1 => {
462                // SAFETY: INTERFACE requires that there are 3 arguments
463                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
464                // SAFETY: - INTERFACE requires that args[0] contains a uint
465                let arg0 = unsafe { args[0].u };
466                // SAFETY: - INTERFACE requires that args[1] contains a uint
467                let arg1 = unsafe { args[1].u };
468                // SAFETY: - INTERFACE requires that args[2] contains an int
469                let arg2 = unsafe { args[2].i };
470                self.0.up(slf, arg0, arg1, arg2);
471            }
472            2 => {
473                // SAFETY: INTERFACE requires that there are 4 arguments
474                let args = unsafe { &*args.cast::<[wl_argument; 4]>() };
475                // SAFETY: - INTERFACE requires that args[0] contains a uint
476                let arg0 = unsafe { args[0].u };
477                // SAFETY: - INTERFACE requires that args[1] contains an int
478                let arg1 = unsafe { args[1].i };
479                // SAFETY: - INTERFACE requires that args[2] contains a fixed
480                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
481                // SAFETY: - INTERFACE requires that args[3] contains a fixed
482                let arg3 = unsafe { Fixed::from_wire(args[3].f) };
483                self.0.motion(slf, arg0, arg1, arg2, arg3);
484            }
485            3 => {
486                self.0.frame(slf);
487            }
488            4 => {
489                self.0.cancel(slf);
490            }
491            5 => {
492                // SAFETY: INTERFACE requires that there are 3 arguments
493                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
494                // SAFETY: - INTERFACE requires that args[0] contains an int
495                let arg0 = unsafe { args[0].i };
496                // SAFETY: - INTERFACE requires that args[1] contains a fixed
497                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
498                // SAFETY: - INTERFACE requires that args[2] contains a fixed
499                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
500                self.0.shape(slf, arg0, arg1, arg2);
501            }
502            6 => {
503                // SAFETY: INTERFACE requires that there are 2 arguments
504                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
505                // SAFETY: - INTERFACE requires that args[0] contains an int
506                let arg0 = unsafe { args[0].i };
507                // SAFETY: - INTERFACE requires that args[1] contains a fixed
508                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
509                self.0.orientation(slf, arg0, arg1);
510            }
511            _ => {
512                invalid_opcode("wl_touch", opcode);
513            }
514        }
515    }
examples/get-registry/../common/protocols_data/wayland/wl_touch.rs (line 488)
451    unsafe fn handle_event(
452        &self,
453        queue: &Queue,
454        data: *mut u8,
455        slf: &UntypedBorrowedProxy,
456        opcode: u32,
457        args: *mut wl_argument,
458    ) {
459        // SAFETY: This function requires that slf has the interface INTERFACE
460        let slf = unsafe { proxy::low_level::from_untyped_borrowed::<WlTouchRef>(slf) };
461        // SAFETY: This function requires that data is `&mut T` where `T`
462        //         has the type id returned by `Self::mutable_type`, i.e.,
463        //         `T = H::Data`.
464        let data: &mut H::Data = unsafe { &mut *data.cast() };
465        match opcode {
466            0 => {
467                // SAFETY: INTERFACE requires that there are 6 arguments
468                let args = unsafe { &*args.cast::<[wl_argument; 6]>() };
469                // SAFETY: - INTERFACE requires that args[0] contains a uint
470                let arg0 = unsafe { args[0].u };
471                // SAFETY: - INTERFACE requires that args[1] contains a uint
472                let arg1 = unsafe { args[1].u };
473                // SAFETY: - INTERFACE requires that args[2] contains an object
474                let arg2 = unsafe {
475                    if let Some(p) = NonNull::new(args[2].o.cast()) {
476                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
477                    } else {
478                        None
479                    }
480                };
481                // SAFETY: - INTERFACE requires that the object has the interface WlSurface::WL_INTERFACE
482                let arg2 = arg2.as_ref().map(|arg2| unsafe {
483                    proxy::low_level::from_untyped_borrowed::<WlSurfaceRef>(arg2)
484                });
485                // SAFETY: - INTERFACE requires that args[3] contains an int
486                let arg3 = unsafe { args[3].i };
487                // SAFETY: - INTERFACE requires that args[4] contains a fixed
488                let arg4 = unsafe { Fixed::from_wire(args[4].f) };
489                // SAFETY: - INTERFACE requires that args[5] contains a fixed
490                let arg5 = unsafe { Fixed::from_wire(args[5].f) };
491                self.0.down(data, slf, arg0, arg1, arg2, arg3, arg4, arg5);
492            }
493            1 => {
494                // SAFETY: INTERFACE requires that there are 3 arguments
495                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
496                // SAFETY: - INTERFACE requires that args[0] contains a uint
497                let arg0 = unsafe { args[0].u };
498                // SAFETY: - INTERFACE requires that args[1] contains a uint
499                let arg1 = unsafe { args[1].u };
500                // SAFETY: - INTERFACE requires that args[2] contains an int
501                let arg2 = unsafe { args[2].i };
502                self.0.up(data, slf, arg0, arg1, arg2);
503            }
504            2 => {
505                // SAFETY: INTERFACE requires that there are 4 arguments
506                let args = unsafe { &*args.cast::<[wl_argument; 4]>() };
507                // SAFETY: - INTERFACE requires that args[0] contains a uint
508                let arg0 = unsafe { args[0].u };
509                // SAFETY: - INTERFACE requires that args[1] contains an int
510                let arg1 = unsafe { args[1].i };
511                // SAFETY: - INTERFACE requires that args[2] contains a fixed
512                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
513                // SAFETY: - INTERFACE requires that args[3] contains a fixed
514                let arg3 = unsafe { Fixed::from_wire(args[3].f) };
515                self.0.motion(data, slf, arg0, arg1, arg2, arg3);
516            }
517            3 => {
518                self.0.frame(data, slf);
519            }
520            4 => {
521                self.0.cancel(data, slf);
522            }
523            5 => {
524                // SAFETY: INTERFACE requires that there are 3 arguments
525                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
526                // SAFETY: - INTERFACE requires that args[0] contains an int
527                let arg0 = unsafe { args[0].i };
528                // SAFETY: - INTERFACE requires that args[1] contains a fixed
529                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
530                // SAFETY: - INTERFACE requires that args[2] contains a fixed
531                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
532                self.0.shape(data, slf, arg0, arg1, arg2);
533            }
534            6 => {
535                // SAFETY: INTERFACE requires that there are 2 arguments
536                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
537                // SAFETY: - INTERFACE requires that args[0] contains an int
538                let arg0 = unsafe { args[0].i };
539                // SAFETY: - INTERFACE requires that args[1] contains a fixed
540                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
541                self.0.orientation(data, slf, arg0, arg1);
542            }
543            _ => {
544                invalid_opcode("wl_touch", opcode);
545            }
546        }
547    }
examples/get-registry/../common/protocols/wayland/wl_data_device.rs (line 548)
502    unsafe fn handle_event(
503        &self,
504        queue: &Queue,
505        data: *mut u8,
506        slf: &UntypedBorrowedProxy,
507        opcode: u32,
508        args: *mut wl_argument,
509    ) {
510        // SAFETY: This function requires that slf has the interface INTERFACE
511        let slf = unsafe { proxy::low_level::from_untyped_borrowed::<WlDataDeviceRef>(slf) };
512        match opcode {
513            0 => {
514                // SAFETY: INTERFACE requires that there are 1 arguments
515                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
516                // SAFETY: - INTERFACE requires that args[0] contains an object
517                //         - ownership is transferred to this function
518                //         - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
519                let arg0 = unsafe {
520                    UntypedOwnedProxy::from_plain_wl_proxy(
521                        queue,
522                        NonNull::new_unchecked(args[0].o.cast()),
523                        WlDataOffer::WL_INTERFACE,
524                    )
525                };
526                // SAFETY: - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
527                let arg0 = unsafe { proxy::low_level::from_untyped_owned::<WlDataOffer>(arg0) };
528                self.0.data_offer(slf, arg0);
529            }
530            1 => {
531                // SAFETY: INTERFACE requires that there are 5 arguments
532                let args = unsafe { &*args.cast::<[wl_argument; 5]>() };
533                // SAFETY: - INTERFACE requires that args[0] contains a uint
534                let arg0 = unsafe { args[0].u };
535                // SAFETY: - INTERFACE requires that args[1] contains an object
536                let arg1 = unsafe {
537                    if let Some(p) = NonNull::new(args[1].o.cast()) {
538                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
539                    } else {
540                        None
541                    }
542                };
543                // SAFETY: - INTERFACE requires that the object has the interface WlSurface::WL_INTERFACE
544                let arg1 = arg1.as_ref().map(|arg1| unsafe {
545                    proxy::low_level::from_untyped_borrowed::<WlSurfaceRef>(arg1)
546                });
547                // SAFETY: - INTERFACE requires that args[2] contains a fixed
548                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
549                // SAFETY: - INTERFACE requires that args[3] contains a fixed
550                let arg3 = unsafe { Fixed::from_wire(args[3].f) };
551                // SAFETY: - INTERFACE requires that args[4] contains an object
552                let arg4 = unsafe {
553                    if let Some(p) = NonNull::new(args[4].o.cast()) {
554                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
555                    } else {
556                        None
557                    }
558                };
559                // SAFETY: - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
560                let arg4 = arg4.as_ref().map(|arg4| unsafe {
561                    proxy::low_level::from_untyped_borrowed::<WlDataOfferRef>(arg4)
562                });
563                self.0.enter(slf, arg0, arg1, arg2, arg3, arg4);
564            }
565            2 => {
566                self.0.leave(slf);
567            }
568            3 => {
569                // SAFETY: INTERFACE requires that there are 3 arguments
570                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
571                // SAFETY: - INTERFACE requires that args[0] contains a uint
572                let arg0 = unsafe { args[0].u };
573                // SAFETY: - INTERFACE requires that args[1] contains a fixed
574                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
575                // SAFETY: - INTERFACE requires that args[2] contains a fixed
576                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
577                self.0.motion(slf, arg0, arg1, arg2);
578            }
579            4 => {
580                self.0.drop(slf);
581            }
582            5 => {
583                // SAFETY: INTERFACE requires that there are 1 arguments
584                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
585                // SAFETY: - INTERFACE requires that args[0] contains an object
586                let arg0 = unsafe {
587                    if let Some(p) = NonNull::new(args[0].o.cast()) {
588                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
589                    } else {
590                        None
591                    }
592                };
593                // SAFETY: - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
594                let arg0 = arg0.as_ref().map(|arg0| unsafe {
595                    proxy::low_level::from_untyped_borrowed::<WlDataOfferRef>(arg0)
596                });
597                self.0.selection(slf, arg0);
598            }
599            _ => {
600                invalid_opcode("wl_data_device", opcode);
601            }
602        }
603    }
examples/get-registry/../common/protocols_data/wayland/wl_data_device.rs (line 577)
527    unsafe fn handle_event(
528        &self,
529        queue: &Queue,
530        data: *mut u8,
531        slf: &UntypedBorrowedProxy,
532        opcode: u32,
533        args: *mut wl_argument,
534    ) {
535        // SAFETY: This function requires that slf has the interface INTERFACE
536        let slf = unsafe { proxy::low_level::from_untyped_borrowed::<WlDataDeviceRef>(slf) };
537        // SAFETY: This function requires that data is `&mut T` where `T`
538        //         has the type id returned by `Self::mutable_type`, i.e.,
539        //         `T = H::Data`.
540        let data: &mut H::Data = unsafe { &mut *data.cast() };
541        match opcode {
542            0 => {
543                // SAFETY: INTERFACE requires that there are 1 arguments
544                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
545                // SAFETY: - INTERFACE requires that args[0] contains an object
546                //         - ownership is transferred to this function
547                //         - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
548                let arg0 = unsafe {
549                    UntypedOwnedProxy::from_plain_wl_proxy(
550                        queue,
551                        NonNull::new_unchecked(args[0].o.cast()),
552                        WlDataOffer::WL_INTERFACE,
553                    )
554                };
555                // SAFETY: - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
556                let arg0 = unsafe { proxy::low_level::from_untyped_owned::<WlDataOffer>(arg0) };
557                self.0.data_offer(data, slf, arg0);
558            }
559            1 => {
560                // SAFETY: INTERFACE requires that there are 5 arguments
561                let args = unsafe { &*args.cast::<[wl_argument; 5]>() };
562                // SAFETY: - INTERFACE requires that args[0] contains a uint
563                let arg0 = unsafe { args[0].u };
564                // SAFETY: - INTERFACE requires that args[1] contains an object
565                let arg1 = unsafe {
566                    if let Some(p) = NonNull::new(args[1].o.cast()) {
567                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
568                    } else {
569                        None
570                    }
571                };
572                // SAFETY: - INTERFACE requires that the object has the interface WlSurface::WL_INTERFACE
573                let arg1 = arg1.as_ref().map(|arg1| unsafe {
574                    proxy::low_level::from_untyped_borrowed::<WlSurfaceRef>(arg1)
575                });
576                // SAFETY: - INTERFACE requires that args[2] contains a fixed
577                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
578                // SAFETY: - INTERFACE requires that args[3] contains a fixed
579                let arg3 = unsafe { Fixed::from_wire(args[3].f) };
580                // SAFETY: - INTERFACE requires that args[4] contains an object
581                let arg4 = unsafe {
582                    if let Some(p) = NonNull::new(args[4].o.cast()) {
583                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
584                    } else {
585                        None
586                    }
587                };
588                // SAFETY: - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
589                let arg4 = arg4.as_ref().map(|arg4| unsafe {
590                    proxy::low_level::from_untyped_borrowed::<WlDataOfferRef>(arg4)
591                });
592                self.0.enter(data, slf, arg0, arg1, arg2, arg3, arg4);
593            }
594            2 => {
595                self.0.leave(data, slf);
596            }
597            3 => {
598                // SAFETY: INTERFACE requires that there are 3 arguments
599                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
600                // SAFETY: - INTERFACE requires that args[0] contains a uint
601                let arg0 = unsafe { args[0].u };
602                // SAFETY: - INTERFACE requires that args[1] contains a fixed
603                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
604                // SAFETY: - INTERFACE requires that args[2] contains a fixed
605                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
606                self.0.motion(data, slf, arg0, arg1, arg2);
607            }
608            4 => {
609                self.0.drop(data, slf);
610            }
611            5 => {
612                // SAFETY: INTERFACE requires that there are 1 arguments
613                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
614                // SAFETY: - INTERFACE requires that args[0] contains an object
615                let arg0 = unsafe {
616                    if let Some(p) = NonNull::new(args[0].o.cast()) {
617                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
618                    } else {
619                        None
620                    }
621                };
622                // SAFETY: - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
623                let arg0 = arg0.as_ref().map(|arg0| unsafe {
624                    proxy::low_level::from_untyped_borrowed::<WlDataOfferRef>(arg0)
625                });
626                self.0.selection(data, slf, arg0);
627            }
628            _ => {
629                invalid_opcode("wl_data_device", opcode);
630            }
631        }
632    }
Source

pub const fn to_wire(self) -> i32

Converts this Fixed to the bits that should be set in the wire protocol.

Examples found in repository?
examples/get-registry/../common/protocols/viewporter/wp_viewport.rs (line 243)
240    pub fn set_source(&self, x: Fixed, y: Fixed, width: Fixed, height: Fixed) {
241        let (arg0, arg1, arg2, arg3) = (x, y, width, height);
242        let mut args = [
243            wl_argument { f: arg0.to_wire() },
244            wl_argument { f: arg1.to_wire() },
245            wl_argument { f: arg2.to_wire() },
246            wl_argument { f: arg3.to_wire() },
247        ];
248        // SAFETY: - self.proxy has the interface INTERFACE
249        //         - 1 < INTERFACE.method_count = 3
250        //         - the request signature is `ffff`
251        unsafe {
252            self.proxy.send_request(1, &mut args);
253        }
254    }
More examples
Hide additional examples
examples/get-registry/../common/protocols_data/viewporter/wp_viewport.rs (line 243)
240    pub fn set_source(&self, x: Fixed, y: Fixed, width: Fixed, height: Fixed) {
241        let (arg0, arg1, arg2, arg3) = (x, y, width, height);
242        let mut args = [
243            wl_argument { f: arg0.to_wire() },
244            wl_argument { f: arg1.to_wire() },
245            wl_argument { f: arg2.to_wire() },
246            wl_argument { f: arg3.to_wire() },
247        ];
248        // SAFETY: - self.proxy has the interface INTERFACE
249        //         - 1 < INTERFACE.method_count = 3
250        //         - the request signature is `ffff`
251        unsafe {
252            self.proxy.send_request(1, &mut args);
253        }
254    }
Source

pub const fn to_f64(self) -> f64

Converts this Fixed to an f64.

This conversion is lossless.

Source

pub const fn to_f32_lossy(self) -> f32

Converts this Fixed to an f32.

This conversion is lossy if there are more than 24 significant bits in this Fixed.

Source

pub const fn from_f64_lossy(val: f64) -> Self

Creates a Fixed from an f64.

If the value cannot be represented exactly, the behavior is as when an f64 is cast to an integer. That is

  • Values are rounded towards 0.
  • NaN returns Fixed::ZERO.
  • Values larger than the maximum return Fixed::MAX.
  • Values smaller than the minimum return Fixed::MIN.
Source

pub const fn from_f32_lossy(val: f32) -> Self

Creates a Fixed from an f32.

The conversion behavior is the same as for Fixed::from_f64_lossy.

Source

pub const fn from_i32_saturating(val: i32) -> Self

Creates a Fixed from an i32.

Values outside of the representable range are clamped to Fixed::MIN and Fixed::MAX.

Source

pub const fn from_i64_saturating(val: i64) -> Self

Creates a Fixed from an i64.

Values outside of the representable range are clamped to Fixed::MIN and Fixed::MAX.

Source

pub const fn to_i32_round_towards_nearest(self) -> i32

Converts this Fixed to an i32.

The conversion rounds towards the nearest integer and half-way away from 0.

Source

pub const fn to_i32_round_towards_zero(self) -> i32

Converts this Fixed to an i32.

The conversion rounds towards zero.

Source

pub const fn to_i32_floor(self) -> i32

Converts this Fixed to an i32.

The conversion rounds towards minus infinity.

Source

pub const fn to_i32_ceil(self) -> i32

Converts this Fixed to an i32.

The conversion rounds towards infinity.

Trait Implementations§

Source§

impl Add for Fixed

Source§

type Output = Fixed

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Fixed) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&Fixed> for Fixed

Source§

type Output = Fixed

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Fixed) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Fixed) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Fixed) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign for Fixed

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl BitAnd for Fixed

Source§

type Output = Fixed

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Fixed) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd<&Fixed> for Fixed

Source§

type Output = Fixed

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &Fixed) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd<&Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &Fixed) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd<Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Fixed) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAndAssign for Fixed

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl BitOr for Fixed

Source§

type Output = Fixed

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Fixed) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<&Fixed> for Fixed

Source§

type Output = Fixed

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &Fixed) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<&Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &Fixed) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Fixed) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOrAssign for Fixed

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl BitXor for Fixed

Source§

type Output = Fixed

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Fixed) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor<&Fixed> for Fixed

Source§

type Output = Fixed

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &Fixed) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor<&Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &Fixed) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor<Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Fixed) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXorAssign for Fixed

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl Clone for Fixed

Source§

fn clone(&self) -> Self

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 Copy for Fixed

Source§

impl Debug for Fixed

Source§

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

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

impl Display for Fixed

Source§

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

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

impl Div for Fixed

Source§

type Output = Fixed

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Fixed) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Fixed> for Fixed

Source§

type Output = Fixed

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Fixed) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Fixed) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Fixed) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign for Fixed

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl Eq for Fixed

Source§

impl From<Fixed> for f64

Source§

fn from(value: Fixed) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for Fixed

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for Fixed

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Fixed

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Fixed

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl Hash for Fixed

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Mul for Fixed

Source§

type Output = Fixed

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Fixed) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Fixed> for Fixed

Source§

type Output = Fixed

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Fixed) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Fixed) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Fixed) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign for Fixed

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl Neg for Fixed

Source§

type Output = Fixed

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Neg for &Fixed

Source§

type Output = Fixed

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Not for Fixed

Source§

type Output = Fixed

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation using logical or bitwise negation. Read more
Source§

impl Not for &Fixed

Source§

type Output = Fixed

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation using logical or bitwise negation. Read more
Source§

impl Ord for Fixed

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for Fixed

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for Fixed

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Rem for Fixed

Source§

type Output = Fixed

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Fixed) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Fixed> for Fixed

Source§

type Output = Fixed

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Fixed) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Fixed) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Fixed) -> Self::Output

Performs the % operation. Read more
Source§

impl RemAssign for Fixed

Source§

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
Source§

impl Shl<&i8> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i8> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i16> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i16> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i32> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i32> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i64> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i64> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i128> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i128> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &i128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&isize> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &isize) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&isize> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &isize) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u8> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u8> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u16> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u16> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u32> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u32> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u64> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u64> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u128> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u128> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &u128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&usize> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &usize) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&usize> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &usize) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i8> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i8> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i16> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i16> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i32> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i32> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i64> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i64> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i128> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i128> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<isize> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: isize) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<isize> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: isize) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u8> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u8> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u16> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u16> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u32> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u32> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u64> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u64> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u128> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u128> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<usize> for Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: usize) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<usize> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: usize) -> Self::Output

Performs the << operation. Read more
Source§

impl ShlAssign<&i8> for Fixed

Source§

fn shl_assign(&mut self, rhs: &i8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i16> for Fixed

Source§

fn shl_assign(&mut self, rhs: &i16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i32> for Fixed

Source§

fn shl_assign(&mut self, rhs: &i32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i64> for Fixed

Source§

fn shl_assign(&mut self, rhs: &i64)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i128> for Fixed

Source§

fn shl_assign(&mut self, rhs: &i128)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&isize> for Fixed

Source§

fn shl_assign(&mut self, rhs: &isize)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u8> for Fixed

Source§

fn shl_assign(&mut self, rhs: &u8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u16> for Fixed

Source§

fn shl_assign(&mut self, rhs: &u16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u32> for Fixed

Source§

fn shl_assign(&mut self, rhs: &u32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u64> for Fixed

Source§

fn shl_assign(&mut self, rhs: &u64)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u128> for Fixed

Source§

fn shl_assign(&mut self, rhs: &u128)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&usize> for Fixed

Source§

fn shl_assign(&mut self, rhs: &usize)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i8> for Fixed

Source§

fn shl_assign(&mut self, rhs: i8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i16> for Fixed

Source§

fn shl_assign(&mut self, rhs: i16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i32> for Fixed

Source§

fn shl_assign(&mut self, rhs: i32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i64> for Fixed

Source§

fn shl_assign(&mut self, rhs: i64)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i128> for Fixed

Source§

fn shl_assign(&mut self, rhs: i128)

Performs the <<= operation. Read more
Source§

impl ShlAssign<isize> for Fixed

Source§

fn shl_assign(&mut self, rhs: isize)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u8> for Fixed

Source§

fn shl_assign(&mut self, rhs: u8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u16> for Fixed

Source§

fn shl_assign(&mut self, rhs: u16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u32> for Fixed

Source§

fn shl_assign(&mut self, rhs: u32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u64> for Fixed

Source§

fn shl_assign(&mut self, rhs: u64)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u128> for Fixed

Source§

fn shl_assign(&mut self, rhs: u128)

Performs the <<= operation. Read more
Source§

impl ShlAssign<usize> for Fixed

Source§

fn shl_assign(&mut self, rhs: usize)

Performs the <<= operation. Read more
Source§

impl Shr<&i8> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i8> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i16> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i16> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i32> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i32> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i64> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i64> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i128> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i128> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&isize> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&isize> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u8> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u8> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u16> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u16> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u32> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u32> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u64> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u64> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u128> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u128> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&usize> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&usize> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i8> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i8> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i16> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i16> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i32> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i32> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i64> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i64> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i128> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i128> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<isize> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<isize> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u8> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u8> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u16> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u16> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u32> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u32> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u64> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u64> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u128> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u128> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<usize> for Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<usize> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl ShrAssign<&i8> for Fixed

Source§

fn shr_assign(&mut self, rhs: &i8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i16> for Fixed

Source§

fn shr_assign(&mut self, rhs: &i16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i32> for Fixed

Source§

fn shr_assign(&mut self, rhs: &i32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i64> for Fixed

Source§

fn shr_assign(&mut self, rhs: &i64)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i128> for Fixed

Source§

fn shr_assign(&mut self, rhs: &i128)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&isize> for Fixed

Source§

fn shr_assign(&mut self, rhs: &isize)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u8> for Fixed

Source§

fn shr_assign(&mut self, rhs: &u8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u16> for Fixed

Source§

fn shr_assign(&mut self, rhs: &u16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u32> for Fixed

Source§

fn shr_assign(&mut self, rhs: &u32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u64> for Fixed

Source§

fn shr_assign(&mut self, rhs: &u64)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u128> for Fixed

Source§

fn shr_assign(&mut self, rhs: &u128)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&usize> for Fixed

Source§

fn shr_assign(&mut self, rhs: &usize)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i8> for Fixed

Source§

fn shr_assign(&mut self, rhs: i8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i16> for Fixed

Source§

fn shr_assign(&mut self, rhs: i16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i32> for Fixed

Source§

fn shr_assign(&mut self, rhs: i32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i64> for Fixed

Source§

fn shr_assign(&mut self, rhs: i64)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i128> for Fixed

Source§

fn shr_assign(&mut self, rhs: i128)

Performs the >>= operation. Read more
Source§

impl ShrAssign<isize> for Fixed

Source§

fn shr_assign(&mut self, rhs: isize)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u8> for Fixed

Source§

fn shr_assign(&mut self, rhs: u8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u16> for Fixed

Source§

fn shr_assign(&mut self, rhs: u16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u32> for Fixed

Source§

fn shr_assign(&mut self, rhs: u32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u64> for Fixed

Source§

fn shr_assign(&mut self, rhs: u64)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u128> for Fixed

Source§

fn shr_assign(&mut self, rhs: u128)

Performs the >>= operation. Read more
Source§

impl ShrAssign<usize> for Fixed

Source§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
Source§

impl StructuralPartialEq for Fixed

Source§

impl Sub for Fixed

Source§

type Output = Fixed

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Fixed) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<&Fixed> for Fixed

Source§

type Output = Fixed

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Fixed) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<&Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Fixed) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<Fixed> for &Fixed

Source§

type Output = Fixed

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Fixed) -> Self::Output

Performs the - operation. Read more
Source§

impl SubAssign for Fixed

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more

Auto Trait Implementations§

§

impl Forget for Fixed

§

impl Freeze for Fixed

§

impl Move for Fixed

§

impl RefUnwindSafe for Fixed

§

impl Send for Fixed

§

impl Sync for Fixed

§

impl Unpin for Fixed

§

impl UnsafeUnpin for Fixed

§

impl UnwindSafe for Fixed

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
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<Lhs, Rhs> IsntPartialEqExt<Lhs, Rhs> for Lhs
where Lhs: PartialEq<Rhs> + ?Sized, Rhs: ?Sized,

Source§

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

The negation of eq
Source§

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

The negation of ne
Source§

impl<Lhs, Rhs> IsntPartialOrdExt<Lhs, Rhs> for Lhs
where Lhs: PartialOrd<Rhs> + ?Sized, Rhs: ?Sized,

Source§

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

The negation of lt
Source§

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

The negation of le
Source§

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

The negation of gt
Source§

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

The negation of ge
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.