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/poll-integration/../common/protocols/tablet_v2/zwp_tablet_pad_ring_v2.rs (line 361)
340    unsafe fn handle_event(
341        &self,
342        queue: &Queue,
343        slf: &UntypedBorrowedProxy,
344        opcode: u32,
345        args: *mut wl_argument,
346    ) {
347        // SAFETY: This function required that slf has the interface INTERFACE
348        let slf = unsafe { proxy::low_level::from_untyped_borrowed::<ZwpTabletPadRingV2Ref>(slf) };
349        match opcode {
350            0 => {
351                // SAFETY: INTERFACE requires that there are 1 arguments
352                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
353                // SAFETY: - INTERFACE requires that args[0] contains a uint
354                let arg0 = unsafe { ZwpTabletPadRingV2Source(args[0].u) };
355                self.0.source(slf, arg0);
356            }
357            1 => {
358                // SAFETY: INTERFACE requires that there are 1 arguments
359                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
360                // SAFETY: - INTERFACE requires that args[0] contains a fixed
361                let arg0 = unsafe { Fixed::from_wire(args[0].f) };
362                self.0.angle(slf, arg0);
363            }
364            2 => {
365                self.0.stop(slf);
366            }
367            3 => {
368                // SAFETY: INTERFACE requires that there are 1 arguments
369                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
370                // SAFETY: - INTERFACE requires that args[0] contains a uint
371                let arg0 = unsafe { args[0].u };
372                self.0.frame(slf, arg0);
373            }
374            _ => {
375                invalid_opcode("zwp_tablet_pad_ring_v2", opcode);
376            }
377        }
378    }
More examples
Hide additional examples
examples/poll-integration/../common/protocols/wayland/wl_touch.rs (line 451)
419    unsafe fn handle_event(
420        &self,
421        queue: &Queue,
422        slf: &UntypedBorrowedProxy,
423        opcode: u32,
424        args: *mut wl_argument,
425    ) {
426        // SAFETY: This function required that slf has the interface INTERFACE
427        let slf = unsafe { proxy::low_level::from_untyped_borrowed::<WlTouchRef>(slf) };
428        match opcode {
429            0 => {
430                // SAFETY: INTERFACE requires that there are 6 arguments
431                let args = unsafe { &*args.cast::<[wl_argument; 6]>() };
432                // SAFETY: - INTERFACE requires that args[0] contains a uint
433                let arg0 = unsafe { args[0].u };
434                // SAFETY: - INTERFACE requires that args[1] contains a uint
435                let arg1 = unsafe { args[1].u };
436                // SAFETY: - INTERFACE requires that args[2] contains an object
437                let arg2 = unsafe {
438                    if let Some(p) = NonNull::new(args[2].o.cast()) {
439                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
440                    } else {
441                        None
442                    }
443                };
444                // SAFETY: - INTERFACE requires that the object has the interface WlSurface::WL_INTERFACE
445                let arg2 = arg2.as_ref().map(|arg2| unsafe {
446                    proxy::low_level::from_untyped_borrowed::<WlSurfaceRef>(arg2)
447                });
448                // SAFETY: - INTERFACE requires that args[3] contains an int
449                let arg3 = unsafe { args[3].i };
450                // SAFETY: - INTERFACE requires that args[4] contains a fixed
451                let arg4 = unsafe { Fixed::from_wire(args[4].f) };
452                // SAFETY: - INTERFACE requires that args[5] contains a fixed
453                let arg5 = unsafe { Fixed::from_wire(args[5].f) };
454                self.0.down(slf, arg0, arg1, arg2, arg3, arg4, arg5);
455            }
456            1 => {
457                // SAFETY: INTERFACE requires that there are 3 arguments
458                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
459                // SAFETY: - INTERFACE requires that args[0] contains a uint
460                let arg0 = unsafe { args[0].u };
461                // SAFETY: - INTERFACE requires that args[1] contains a uint
462                let arg1 = unsafe { args[1].u };
463                // SAFETY: - INTERFACE requires that args[2] contains an int
464                let arg2 = unsafe { args[2].i };
465                self.0.up(slf, arg0, arg1, arg2);
466            }
467            2 => {
468                // SAFETY: INTERFACE requires that there are 4 arguments
469                let args = unsafe { &*args.cast::<[wl_argument; 4]>() };
470                // SAFETY: - INTERFACE requires that args[0] contains a uint
471                let arg0 = unsafe { args[0].u };
472                // SAFETY: - INTERFACE requires that args[1] contains an int
473                let arg1 = unsafe { args[1].i };
474                // SAFETY: - INTERFACE requires that args[2] contains a fixed
475                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
476                // SAFETY: - INTERFACE requires that args[3] contains a fixed
477                let arg3 = unsafe { Fixed::from_wire(args[3].f) };
478                self.0.motion(slf, arg0, arg1, arg2, arg3);
479            }
480            3 => {
481                self.0.frame(slf);
482            }
483            4 => {
484                self.0.cancel(slf);
485            }
486            5 => {
487                // SAFETY: INTERFACE requires that there are 3 arguments
488                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
489                // SAFETY: - INTERFACE requires that args[0] contains an int
490                let arg0 = unsafe { args[0].i };
491                // SAFETY: - INTERFACE requires that args[1] contains a fixed
492                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
493                // SAFETY: - INTERFACE requires that args[2] contains a fixed
494                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
495                self.0.shape(slf, arg0, arg1, arg2);
496            }
497            6 => {
498                // SAFETY: INTERFACE requires that there are 2 arguments
499                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
500                // SAFETY: - INTERFACE requires that args[0] contains an int
501                let arg0 = unsafe { args[0].i };
502                // SAFETY: - INTERFACE requires that args[1] contains a fixed
503                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
504                self.0.orientation(slf, arg0, arg1);
505            }
506            _ => {
507                invalid_opcode("wl_touch", opcode);
508            }
509        }
510    }
examples/poll-integration/../common/protocols/wayland/wl_data_device.rs (line 535)
490    unsafe fn handle_event(
491        &self,
492        queue: &Queue,
493        slf: &UntypedBorrowedProxy,
494        opcode: u32,
495        args: *mut wl_argument,
496    ) {
497        // SAFETY: This function required that slf has the interface INTERFACE
498        let slf = unsafe { proxy::low_level::from_untyped_borrowed::<WlDataDeviceRef>(slf) };
499        match opcode {
500            0 => {
501                // SAFETY: INTERFACE requires that there are 1 arguments
502                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
503                // SAFETY: - INTERFACE requires that args[0] contains an object
504                //         - ownership is transferred to this function
505                //         - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
506                let arg0 = unsafe {
507                    UntypedOwnedProxy::from_plain_wl_proxy(
508                        queue,
509                        NonNull::new_unchecked(args[0].o.cast()),
510                        WlDataOffer::WL_INTERFACE,
511                    )
512                };
513                // SAFETY: - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
514                let arg0 = unsafe { proxy::low_level::from_untyped_owned::<WlDataOffer>(arg0) };
515                self.0.data_offer(slf, arg0);
516            }
517            1 => {
518                // SAFETY: INTERFACE requires that there are 5 arguments
519                let args = unsafe { &*args.cast::<[wl_argument; 5]>() };
520                // SAFETY: - INTERFACE requires that args[0] contains a uint
521                let arg0 = unsafe { args[0].u };
522                // SAFETY: - INTERFACE requires that args[1] contains an object
523                let arg1 = unsafe {
524                    if let Some(p) = NonNull::new(args[1].o.cast()) {
525                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
526                    } else {
527                        None
528                    }
529                };
530                // SAFETY: - INTERFACE requires that the object has the interface WlSurface::WL_INTERFACE
531                let arg1 = arg1.as_ref().map(|arg1| unsafe {
532                    proxy::low_level::from_untyped_borrowed::<WlSurfaceRef>(arg1)
533                });
534                // SAFETY: - INTERFACE requires that args[2] contains a fixed
535                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
536                // SAFETY: - INTERFACE requires that args[3] contains a fixed
537                let arg3 = unsafe { Fixed::from_wire(args[3].f) };
538                // SAFETY: - INTERFACE requires that args[4] contains an object
539                let arg4 = unsafe {
540                    if let Some(p) = NonNull::new(args[4].o.cast()) {
541                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
542                    } else {
543                        None
544                    }
545                };
546                // SAFETY: - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
547                let arg4 = arg4.as_ref().map(|arg4| unsafe {
548                    proxy::low_level::from_untyped_borrowed::<WlDataOfferRef>(arg4)
549                });
550                self.0.enter(slf, arg0, arg1, arg2, arg3, arg4);
551            }
552            2 => {
553                self.0.leave(slf);
554            }
555            3 => {
556                // SAFETY: INTERFACE requires that there are 3 arguments
557                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
558                // SAFETY: - INTERFACE requires that args[0] contains a uint
559                let arg0 = unsafe { args[0].u };
560                // SAFETY: - INTERFACE requires that args[1] contains a fixed
561                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
562                // SAFETY: - INTERFACE requires that args[2] contains a fixed
563                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
564                self.0.motion(slf, arg0, arg1, arg2);
565            }
566            4 => {
567                self.0.drop(slf);
568            }
569            5 => {
570                // SAFETY: INTERFACE requires that there are 1 arguments
571                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
572                // SAFETY: - INTERFACE requires that args[0] contains an object
573                let arg0 = unsafe {
574                    if let Some(p) = NonNull::new(args[0].o.cast()) {
575                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
576                    } else {
577                        None
578                    }
579                };
580                // SAFETY: - INTERFACE requires that the object has the interface WlDataOffer::WL_INTERFACE
581                let arg0 = arg0.as_ref().map(|arg0| unsafe {
582                    proxy::low_level::from_untyped_borrowed::<WlDataOfferRef>(arg0)
583                });
584                self.0.selection(slf, arg0);
585            }
586            _ => {
587                invalid_opcode("wl_data_device", opcode);
588            }
589        }
590    }
examples/poll-integration/../common/protocols/wayland/wl_pointer.rs (line 787)
759    unsafe fn handle_event(
760        &self,
761        queue: &Queue,
762        slf: &UntypedBorrowedProxy,
763        opcode: u32,
764        args: *mut wl_argument,
765    ) {
766        // SAFETY: This function required that slf has the interface INTERFACE
767        let slf = unsafe { proxy::low_level::from_untyped_borrowed::<WlPointerRef>(slf) };
768        match opcode {
769            0 => {
770                // SAFETY: INTERFACE requires that there are 4 arguments
771                let args = unsafe { &*args.cast::<[wl_argument; 4]>() };
772                // SAFETY: - INTERFACE requires that args[0] contains a uint
773                let arg0 = unsafe { args[0].u };
774                // SAFETY: - INTERFACE requires that args[1] contains an object
775                let arg1 = unsafe {
776                    if let Some(p) = NonNull::new(args[1].o.cast()) {
777                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
778                    } else {
779                        None
780                    }
781                };
782                // SAFETY: - INTERFACE requires that the object has the interface WlSurface::WL_INTERFACE
783                let arg1 = arg1.as_ref().map(|arg1| unsafe {
784                    proxy::low_level::from_untyped_borrowed::<WlSurfaceRef>(arg1)
785                });
786                // SAFETY: - INTERFACE requires that args[2] contains a fixed
787                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
788                // SAFETY: - INTERFACE requires that args[3] contains a fixed
789                let arg3 = unsafe { Fixed::from_wire(args[3].f) };
790                self.0.enter(slf, arg0, arg1, arg2, arg3);
791            }
792            1 => {
793                // SAFETY: INTERFACE requires that there are 2 arguments
794                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
795                // SAFETY: - INTERFACE requires that args[0] contains a uint
796                let arg0 = unsafe { args[0].u };
797                // SAFETY: - INTERFACE requires that args[1] contains an object
798                let arg1 = unsafe {
799                    if let Some(p) = NonNull::new(args[1].o.cast()) {
800                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
801                    } else {
802                        None
803                    }
804                };
805                // SAFETY: - INTERFACE requires that the object has the interface WlSurface::WL_INTERFACE
806                let arg1 = arg1.as_ref().map(|arg1| unsafe {
807                    proxy::low_level::from_untyped_borrowed::<WlSurfaceRef>(arg1)
808                });
809                self.0.leave(slf, arg0, arg1);
810            }
811            2 => {
812                // SAFETY: INTERFACE requires that there are 3 arguments
813                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
814                // SAFETY: - INTERFACE requires that args[0] contains a uint
815                let arg0 = unsafe { args[0].u };
816                // SAFETY: - INTERFACE requires that args[1] contains a fixed
817                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
818                // SAFETY: - INTERFACE requires that args[2] contains a fixed
819                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
820                self.0.motion(slf, arg0, arg1, arg2);
821            }
822            3 => {
823                // SAFETY: INTERFACE requires that there are 4 arguments
824                let args = unsafe { &*args.cast::<[wl_argument; 4]>() };
825                // SAFETY: - INTERFACE requires that args[0] contains a uint
826                let arg0 = unsafe { args[0].u };
827                // SAFETY: - INTERFACE requires that args[1] contains a uint
828                let arg1 = unsafe { args[1].u };
829                // SAFETY: - INTERFACE requires that args[2] contains a uint
830                let arg2 = unsafe { args[2].u };
831                // SAFETY: - INTERFACE requires that args[3] contains a uint
832                let arg3 = unsafe { WlPointerButtonState(args[3].u) };
833                self.0.button(slf, arg0, arg1, arg2, arg3);
834            }
835            4 => {
836                // SAFETY: INTERFACE requires that there are 3 arguments
837                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
838                // SAFETY: - INTERFACE requires that args[0] contains a uint
839                let arg0 = unsafe { args[0].u };
840                // SAFETY: - INTERFACE requires that args[1] contains a uint
841                let arg1 = unsafe { WlPointerAxis(args[1].u) };
842                // SAFETY: - INTERFACE requires that args[2] contains a fixed
843                let arg2 = unsafe { Fixed::from_wire(args[2].f) };
844                self.0.axis(slf, arg0, arg1, arg2);
845            }
846            5 => {
847                self.0.frame(slf);
848            }
849            6 => {
850                // SAFETY: INTERFACE requires that there are 1 arguments
851                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
852                // SAFETY: - INTERFACE requires that args[0] contains a uint
853                let arg0 = unsafe { WlPointerAxisSource(args[0].u) };
854                self.0.axis_source(slf, arg0);
855            }
856            7 => {
857                // SAFETY: INTERFACE requires that there are 2 arguments
858                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
859                // SAFETY: - INTERFACE requires that args[0] contains a uint
860                let arg0 = unsafe { args[0].u };
861                // SAFETY: - INTERFACE requires that args[1] contains a uint
862                let arg1 = unsafe { WlPointerAxis(args[1].u) };
863                self.0.axis_stop(slf, arg0, arg1);
864            }
865            8 => {
866                // SAFETY: INTERFACE requires that there are 2 arguments
867                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
868                // SAFETY: - INTERFACE requires that args[0] contains a uint
869                let arg0 = unsafe { WlPointerAxis(args[0].u) };
870                // SAFETY: - INTERFACE requires that args[1] contains an int
871                let arg1 = unsafe { args[1].i };
872                self.0.axis_discrete(slf, arg0, arg1);
873            }
874            9 => {
875                // SAFETY: INTERFACE requires that there are 2 arguments
876                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
877                // SAFETY: - INTERFACE requires that args[0] contains a uint
878                let arg0 = unsafe { WlPointerAxis(args[0].u) };
879                // SAFETY: - INTERFACE requires that args[1] contains an int
880                let arg1 = unsafe { args[1].i };
881                self.0.axis_value120(slf, arg0, arg1);
882            }
883            10 => {
884                // SAFETY: INTERFACE requires that there are 2 arguments
885                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
886                // SAFETY: - INTERFACE requires that args[0] contains a uint
887                let arg0 = unsafe { WlPointerAxis(args[0].u) };
888                // SAFETY: - INTERFACE requires that args[1] contains a uint
889                let arg1 = unsafe { WlPointerAxisRelativeDirection(args[1].u) };
890                self.0.axis_relative_direction(slf, arg0, arg1);
891            }
892            _ => {
893                invalid_opcode("wl_pointer", opcode);
894            }
895        }
896    }
examples/poll-integration/../common/protocols/tablet_v2/zwp_tablet_tool_v2.rs (line 957)
861    unsafe fn handle_event(
862        &self,
863        queue: &Queue,
864        slf: &UntypedBorrowedProxy,
865        opcode: u32,
866        args: *mut wl_argument,
867    ) {
868        // SAFETY: This function required that slf has the interface INTERFACE
869        let slf = unsafe { proxy::low_level::from_untyped_borrowed::<ZwpTabletToolV2Ref>(slf) };
870        match opcode {
871            0 => {
872                // SAFETY: INTERFACE requires that there are 1 arguments
873                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
874                // SAFETY: - INTERFACE requires that args[0] contains a uint
875                let arg0 = unsafe { ZwpTabletToolV2Type(args[0].u) };
876                self.0.r#type(slf, arg0);
877            }
878            1 => {
879                // SAFETY: INTERFACE requires that there are 2 arguments
880                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
881                // SAFETY: - INTERFACE requires that args[0] contains a uint
882                let arg0 = unsafe { args[0].u };
883                // SAFETY: - INTERFACE requires that args[1] contains a uint
884                let arg1 = unsafe { args[1].u };
885                self.0.hardware_serial(slf, arg0, arg1);
886            }
887            2 => {
888                // SAFETY: INTERFACE requires that there are 2 arguments
889                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
890                // SAFETY: - INTERFACE requires that args[0] contains a uint
891                let arg0 = unsafe { args[0].u };
892                // SAFETY: - INTERFACE requires that args[1] contains a uint
893                let arg1 = unsafe { args[1].u };
894                self.0.hardware_id_wacom(slf, arg0, arg1);
895            }
896            3 => {
897                // SAFETY: INTERFACE requires that there are 1 arguments
898                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
899                // SAFETY: - INTERFACE requires that args[0] contains a uint
900                let arg0 = unsafe { ZwpTabletToolV2Capability(args[0].u) };
901                self.0.capability(slf, arg0);
902            }
903            4 => {
904                self.0.done(slf);
905            }
906            5 => {
907                self.0.removed(slf);
908            }
909            6 => {
910                // SAFETY: INTERFACE requires that there are 3 arguments
911                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
912                // SAFETY: - INTERFACE requires that args[0] contains a uint
913                let arg0 = unsafe { args[0].u };
914                // SAFETY: - INTERFACE requires that args[1] contains an object
915                let arg1 = unsafe {
916                    if let Some(p) = NonNull::new(args[1].o.cast()) {
917                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
918                    } else {
919                        None
920                    }
921                };
922                // SAFETY: - INTERFACE requires that the object has the interface ZwpTabletV2::WL_INTERFACE
923                let arg1 = arg1.as_ref().map(|arg1| unsafe {
924                    proxy::low_level::from_untyped_borrowed::<ZwpTabletV2Ref>(arg1)
925                });
926                // SAFETY: - INTERFACE requires that args[2] contains an object
927                let arg2 = unsafe {
928                    if let Some(p) = NonNull::new(args[2].o.cast()) {
929                        Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
930                    } else {
931                        None
932                    }
933                };
934                // SAFETY: - INTERFACE requires that the object has the interface WlSurface::WL_INTERFACE
935                let arg2 = arg2.as_ref().map(|arg2| unsafe {
936                    proxy::low_level::from_untyped_borrowed::<WlSurfaceRef>(arg2)
937                });
938                self.0.proximity_in(slf, arg0, arg1, arg2);
939            }
940            7 => {
941                self.0.proximity_out(slf);
942            }
943            8 => {
944                // SAFETY: INTERFACE requires that there are 1 arguments
945                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
946                // SAFETY: - INTERFACE requires that args[0] contains a uint
947                let arg0 = unsafe { args[0].u };
948                self.0.down(slf, arg0);
949            }
950            9 => {
951                self.0.up(slf);
952            }
953            10 => {
954                // SAFETY: INTERFACE requires that there are 2 arguments
955                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
956                // SAFETY: - INTERFACE requires that args[0] contains a fixed
957                let arg0 = unsafe { Fixed::from_wire(args[0].f) };
958                // SAFETY: - INTERFACE requires that args[1] contains a fixed
959                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
960                self.0.motion(slf, arg0, arg1);
961            }
962            11 => {
963                // SAFETY: INTERFACE requires that there are 1 arguments
964                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
965                // SAFETY: - INTERFACE requires that args[0] contains a uint
966                let arg0 = unsafe { args[0].u };
967                self.0.pressure(slf, arg0);
968            }
969            12 => {
970                // SAFETY: INTERFACE requires that there are 1 arguments
971                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
972                // SAFETY: - INTERFACE requires that args[0] contains a uint
973                let arg0 = unsafe { args[0].u };
974                self.0.distance(slf, arg0);
975            }
976            13 => {
977                // SAFETY: INTERFACE requires that there are 2 arguments
978                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
979                // SAFETY: - INTERFACE requires that args[0] contains a fixed
980                let arg0 = unsafe { Fixed::from_wire(args[0].f) };
981                // SAFETY: - INTERFACE requires that args[1] contains a fixed
982                let arg1 = unsafe { Fixed::from_wire(args[1].f) };
983                self.0.tilt(slf, arg0, arg1);
984            }
985            14 => {
986                // SAFETY: INTERFACE requires that there are 1 arguments
987                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
988                // SAFETY: - INTERFACE requires that args[0] contains a fixed
989                let arg0 = unsafe { Fixed::from_wire(args[0].f) };
990                self.0.rotation(slf, arg0);
991            }
992            15 => {
993                // SAFETY: INTERFACE requires that there are 1 arguments
994                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
995                // SAFETY: - INTERFACE requires that args[0] contains an int
996                let arg0 = unsafe { args[0].i };
997                self.0.slider(slf, arg0);
998            }
999            16 => {
1000                // SAFETY: INTERFACE requires that there are 2 arguments
1001                let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
1002                // SAFETY: - INTERFACE requires that args[0] contains a fixed
1003                let arg0 = unsafe { Fixed::from_wire(args[0].f) };
1004                // SAFETY: - INTERFACE requires that args[1] contains an int
1005                let arg1 = unsafe { args[1].i };
1006                self.0.wheel(slf, arg0, arg1);
1007            }
1008            17 => {
1009                // SAFETY: INTERFACE requires that there are 3 arguments
1010                let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
1011                // SAFETY: - INTERFACE requires that args[0] contains a uint
1012                let arg0 = unsafe { args[0].u };
1013                // SAFETY: - INTERFACE requires that args[1] contains a uint
1014                let arg1 = unsafe { args[1].u };
1015                // SAFETY: - INTERFACE requires that args[2] contains a uint
1016                let arg2 = unsafe { ZwpTabletToolV2ButtonState(args[2].u) };
1017                self.0.button(slf, arg0, arg1, arg2);
1018            }
1019            18 => {
1020                // SAFETY: INTERFACE requires that there are 1 arguments
1021                let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
1022                // SAFETY: - INTERFACE requires that args[0] contains a uint
1023                let arg0 = unsafe { args[0].u };
1024                self.0.frame(slf, arg0);
1025            }
1026            _ => {
1027                invalid_opcode("zwp_tablet_tool_v2", opcode);
1028            }
1029        }
1030    }
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/poll-integration/../common/protocols/viewporter/wp_viewport.rs (line 231)
228    pub fn set_source(&self, x: Fixed, y: Fixed, width: Fixed, height: Fixed) {
229        let (arg0, arg1, arg2, arg3) = (x, y, width, height);
230        let mut args = [
231            wl_argument { f: arg0.to_wire() },
232            wl_argument { f: arg1.to_wire() },
233            wl_argument { f: arg2.to_wire() },
234            wl_argument { f: arg3.to_wire() },
235        ];
236        // SAFETY: - self.proxy has the interface INTERFACE
237        //         - 1 < INTERFACE.method_count = 3
238        //         - the request signature is `ffff`
239        unsafe {
240            self.proxy.send_request(1, &mut args);
241        }
242    }
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<&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 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 AddAssign for Fixed

Source§

fn add_assign(&mut self, rhs: Self)

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

Source§

fn bitand_assign(&mut self, rhs: Self)

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

Source§

fn bitor_assign(&mut self, rhs: Self)

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

Returns a copy 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 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<&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 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 DivAssign for Fixed

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl From<Fixed> for f64

Source§

fn from(value: Fixed) -> 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<i8> for Fixed

Source§

fn from(value: i8) -> 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 From<u8> for Fixed

Source§

fn from(value: u8) -> 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<&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 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 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. 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. Read more
Source§

impl Ord for Fixed

Source§

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

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

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

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

impl PartialEq for Fixed

Source§

fn eq(&self, other: &Fixed) -> 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 PartialOrd for Fixed

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · 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 · 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 · 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 · 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<&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 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 RemAssign for Fixed

Source§

fn rem_assign(&mut self, rhs: Self)

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<&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<&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<&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<&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<&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<&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<&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<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<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<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<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<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<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<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<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<&i128> for Fixed

Source§

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

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<&i8> for Fixed

Source§

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

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<&u128> for Fixed

Source§

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

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<&u8> for Fixed

Source§

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

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

Source§

fn shl_assign(&mut self, rhs: i128)

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

Source§

fn shl_assign(&mut self, rhs: i8)

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

Source§

fn shl_assign(&mut self, rhs: u128)

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

Source§

fn shl_assign(&mut self, rhs: u8)

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<&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<&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<&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<&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<&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<&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<&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<&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<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<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<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<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<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<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<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<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<&i128> for Fixed

Source§

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

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<&i8> for Fixed

Source§

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

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<&u128> for Fixed

Source§

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

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<&u8> for Fixed

Source§

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

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

Source§

fn shr_assign(&mut self, rhs: i128)

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

Source§

fn shr_assign(&mut self, rhs: i8)

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

Source§

fn shr_assign(&mut self, rhs: u128)

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

Source§

fn shr_assign(&mut self, rhs: u8)

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

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl Copy for Fixed

Source§

impl Eq for Fixed

Source§

impl StructuralPartialEq for Fixed

Auto Trait Implementations§

§

impl Freeze for Fixed

§

impl RefUnwindSafe for Fixed

§

impl Send for Fixed

§

impl Sync for Fixed

§

impl Unpin 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.