Debian Codegraph @

src/as_bytes.rs

raw symbols SCIP
1 use craterust-analyzer cargo rgb 0.8.53 crate/::{RGBrust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#, RGBArust-analyzer cargo rgb 0.8.53 formats/rgba/Rgba#};
2 use craterust-analyzer cargo rgb 0.8.53 crate/::altrust-analyzer cargo rgb 0.8.53 legacy/alt/::{Grayrust-analyzer cargo rgb 0.8.53 formats/gray/Gray_v08#, GrayAlpharust-analyzer cargo rgb 0.8.53 formats/gray_alpha/GrayAlpha_v08#, BGRrust-analyzer cargo rgb 0.8.53 formats/bgr/Bgr#, BGRArust-analyzer cargo rgb 0.8.53 formats/bgra/Bgra#};
3 use craterust-analyzer cargo rgb 0.8.53 crate/::altrust-analyzer cargo rgb 0.8.53 legacy/alt/::{ARGBrust-analyzer cargo rgb 0.8.53 formats/argb/Argb#, ABGRrust-analyzer cargo rgb 0.8.53 formats/abgr/Abgr#};
4 use craterust-analyzer cargo rgb 0.8.53 crate/::ComponentBytesrust-analyzer cargo rgb 0.8.53 legacy/internal/pixel/ComponentBytes#;
5
6 #[cfg(feature = "as-bytes")]
7 unsafe impl<T> craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# for RGBrust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#<T> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# {}
8 #[cfg(feature = "as-bytes")]
9 unsafe impl<T> craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# for BGRrust-analyzer cargo rgb 0.8.53 formats/bgr/Bgr#<T> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# {}
10 #[cfg(feature = "as-bytes")]
11 unsafe impl<T> craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# for RGBrust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#<T> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# {}
12 #[cfg(feature = "as-bytes")]
13 unsafe impl<T> craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# for BGRrust-analyzer cargo rgb 0.8.53 formats/bgr/Bgr#<T> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# {}
14
15 #[cfg(feature = "as-bytes")]
16 /// This is unsound. You can disable `as-bytes` feature, enable `bytemuck`, and use `bytemuck::cast_slice()` instead.
17 unsafe impl<T, A> craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# for ABGRrust-analyzer cargo rgb 0.8.53 formats/abgr/Abgr#<T, A> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable#, A: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# {
18 #[track_caller]
19 #[inline(always)]
20 fn zeroedrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`ABGR<T, A>`][Zeroable]zeroed().() -> Selfrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`ABGR<T, A>`][Zeroable] {
21 unsafe {
22 assert_no_paddingrust-analyzer cargo rgb 0.8.53 as_bytes/assert_no_padding().::<T, A, Selfrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`ABGR<T, A>`][Zeroable]>();
23 corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::zeroedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/zeroed().()
24 }
25 }
26 }
27
28 #[track_caller]
29 const fn assert_no_paddingrust-analyzer cargo rgb 0.8.53 as_bytes/assert_no_padding().<T, A, S>() {
30 if corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<A>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().3 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<T>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<S>() {
31 panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("type has padding");
32 }
33 }
34
35 #[cfg(feature = "as-bytes")]
36 /// This is unsound. You can disable `as-bytes` feature, enable `bytemuck`, and use `bytemuck::cast_slice()` instead.
37 unsafe impl<T, A> craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# for RGBArust-analyzer cargo rgb 0.8.53 formats/rgba/Rgba#<T, A> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod#, A: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# {}
38
39 #[cfg(feature = "as-bytes")]
40 /// This is unsound. You can disable `as-bytes` feature, enable `bytemuck`, and use `bytemuck::cast_slice()` instead.
41 unsafe impl<T, A> craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# for BGRArust-analyzer cargo rgb 0.8.53 formats/bgra/Bgra#<T, A> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod#, A: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# {}
42
43 #[cfg(feature = "as-bytes")]
44 /// This is unsound. You can disable `as-bytes` feature, enable `bytemuck`, and use `bytemuck::cast_slice()` instead.
45 unsafe impl<T, A> craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# for RGBArust-analyzer cargo rgb 0.8.53 formats/rgba/Rgba#<T, A> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable#, A: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# {
46 #[track_caller]
47 #[inline(always)]
48 fn zeroedrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`RGBA<T, A>`][Zeroable]zeroed().() -> Selfrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`RGBA<T, A>`][Zeroable] {
49 unsafe {
50 assert_no_paddingrust-analyzer cargo rgb 0.8.53 as_bytes/assert_no_padding().::<T, A, Selfrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`RGBA<T, A>`][Zeroable]>();
51 corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::zeroedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/zeroed().()
52 }
53 }
54 }
55
56 #[cfg(feature = "as-bytes")]
57 /// This is unsound. You can disable `as-bytes` feature, enable `bytemuck`, and use `bytemuck::cast_slice()` instead.
58 unsafe impl<T, A> craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# for ARGBrust-analyzer cargo rgb 0.8.53 formats/argb/Argb#<T, A> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod#, A: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# {}
59
60 #[cfg(feature = "as-bytes")]
61 /// This is unsound. You can disable `as-bytes` feature, enable `bytemuck`, and use `bytemuck::cast_slice()` instead.
62 unsafe impl<T, A> craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# for ABGRrust-analyzer cargo rgb 0.8.53 formats/abgr/Abgr#<T, A> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod#, A: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# {}
63
64 #[cfg(feature = "as-bytes")]
65 /// This is unsound. You can disable `as-bytes` feature, enable `bytemuck`, and use `bytemuck::cast_slice()` instead.
66 unsafe impl<T, A> craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# for ARGBrust-analyzer cargo rgb 0.8.53 formats/argb/Argb#<T, A> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable#, A: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# {
67 #[track_caller]
68 #[inline(always)]
69 fn zeroedrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`ARGB<T, A>`][Zeroable]zeroed().() -> Selfrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`ARGB<T, A>`][Zeroable] {
70 unsafe {
71 assert_no_paddingrust-analyzer cargo rgb 0.8.53 as_bytes/assert_no_padding().::<T, A, Selfrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`ARGB<T, A>`][Zeroable]>();
72 corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::zeroedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/zeroed().()
73 }
74 }
75 }
76
77 #[cfg(feature = "as-bytes")]
78 /// This is unsound. You can disable `as-bytes` feature, enable `bytemuck`, and use `bytemuck::cast_slice()` instead.
79 unsafe impl<T, A> craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# for BGRArust-analyzer cargo rgb 0.8.53 formats/bgra/Bgra#<T, A> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable#, A: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# {
80 #[track_caller]
81 #[inline(always)]
82 fn zeroedrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`BGRA<T, A>`][Zeroable]zeroed().() -> Selfrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`BGRA<T, A>`][Zeroable] {
83 unsafe {
84 assert_no_paddingrust-analyzer cargo rgb 0.8.53 as_bytes/assert_no_padding().::<T, A, Selfrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`BGRA<T, A>`][Zeroable]>();
85 corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::zeroedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/zeroed().()
86 }
87 }
88 }
89
90 #[cfg(feature = "as-bytes")]
91 unsafe impl<T> craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# for Grayrust-analyzer cargo rgb 0.8.53 formats/gray/Gray_v08#<T> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# {}
92 #[cfg(feature = "as-bytes")]
93 /// This is unsound. You can disable `as-bytes` feature, enable `bytemuck`, and use `bytemuck::cast_slice()` instead.
94 unsafe impl<T, A> craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# for GrayAlpharust-analyzer cargo rgb 0.8.53 formats/gray_alpha/GrayAlpha_v08#<T, A> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod#, A: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod# {}
95 #[cfg(feature = "as-bytes")]
96 unsafe impl<T> craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# for Grayrust-analyzer cargo rgb 0.8.53 formats/gray/Gray_v08#<T> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# {}
97 #[cfg(feature = "as-bytes")]
98 /// This is unsound. You can disable `as-bytes` feature, enable `bytemuck`, and use `bytemuck::cast_slice()` instead.
99 unsafe impl<T, A> craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# for GrayAlpharust-analyzer cargo rgb 0.8.53 formats/gray_alpha/GrayAlpha_v08#<T, A> where T: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable#, A: craterust-analyzer cargo rgb 0.8.53 crate/::Zeroablerust-analyzer cargo bytemuck 1.23.2 zeroable/Zeroable# {
100 #[track_caller]
101 #[inline(always)]
102 fn zeroedrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`GrayAlpha<T, A>`][Zeroable]zeroed().() -> Selfrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`GrayAlpha<T, A>`][Zeroable] {
103 unsafe {
104 if corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<A>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<T>() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<Selfrust-analyzer cargo rgb 0.8.53 as_bytes/impl#[`GrayAlpha<T, A>`][Zeroable]>() {
105 panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("type has padding");
106 }
107 corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::zeroedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/zeroed().()
108 }
109 }
110 }
111
112 #[cfg(feature = "as-bytes")]
113 impl<T: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod#> ComponentBytesrust-analyzer cargo rgb 0.8.53 legacy/internal/pixel/ComponentBytes#<T> for [Grayrust-analyzer cargo rgb 0.8.53 formats/gray/Gray_v08#<T>] {}
114
115 #[cfg(feature = "as-bytes")]
116 impl<T: craterust-analyzer cargo rgb 0.8.53 crate/::Podrust-analyzer cargo bytemuck 1.23.2 pod/Pod#> ComponentBytesrust-analyzer cargo rgb 0.8.53 legacy/internal/pixel/ComponentBytes#<T> for [GrayAlpharust-analyzer cargo rgb 0.8.53 formats/gray_alpha/GrayAlpha_v08#<T>] {}
117