1use core::convert::TryFrom;
2use mproto::{BaseLen, Compatible, Decode, DecodeCursor, DecodeError, DecodeResult, Encode, EncodeCursor, Lazy, Owned};
3
4#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)]
5pub struct PropertyUpdate<T> {
6 pub new_value: T,
7}
8
9pub struct PropertyUpdateLazy<'a, T> {
10 buffer: &'a [u8],
11 offset: usize,
12 _t: core::marker::PhantomData<T>,
13}
14
15pub struct PropertyUpdateGen<
16 NewValue: Encode,
17> {
18 pub new_value: NewValue,
19}
20
21impl<
22 T: Owned,
23 NewValue: Encode + Compatible<T>
24> Compatible<PropertyUpdate<T>> for PropertyUpdateGen<NewValue> { }
25impl<
26 T: Owned,
27 NewValue: Encode + Compatible<T>
28> Compatible<PropertyUpdateGen<NewValue>> for PropertyUpdate<T> { }
29
30impl<
31 NewValue: Encode,
32> BaseLen for PropertyUpdateGen<NewValue> {
33 const BASE_LEN: usize = NewValue::BASE_LEN;
34}
35
36impl<
37 NewValue: Encode,
38> Encode for PropertyUpdateGen<NewValue> {
39 fn scratch_len(&self) -> usize {
40 self.new_value.scratch_len()
41 }
42
43 fn encode(&self, cursor: &mut EncodeCursor) {
44 self.new_value.encode(cursor);
45 }
46}
47
48impl<T: Owned> Owned for PropertyUpdate<T> {
49 type Lazy<'a> = PropertyUpdateLazy<'a, T>;
50
51 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
52 TryFrom::try_from(lazy)
53 }
54}
55
56impl<'a, T: Owned> Lazy<'a> for PropertyUpdateLazy<'a, T> {
57 type Owned = PropertyUpdate<T>;
58}
59
60impl<'a, T: Owned> Compatible<PropertyUpdateLazy<'a, T>> for PropertyUpdateLazy<'a, T> { }
61impl<'a, T: Owned> Compatible<PropertyUpdateLazy<'a, T>> for PropertyUpdate<T> { }
62impl<T: Owned> Compatible<PropertyUpdate<T>> for PropertyUpdate<T> { }
63impl<'a, T: Owned> Compatible<PropertyUpdate<T>> for PropertyUpdateLazy<'a, T> { }
64
65impl<'a, T: Owned> PropertyUpdateLazy<'a, T> {
66
67 pub fn new_value(&self) -> DecodeResult<T::Lazy<'a>> {
68 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0))
69 }
70}
71
72impl<T: BaseLen> BaseLen for PropertyUpdate<T> {
73 const BASE_LEN: usize = T::BASE_LEN;
74}
75
76impl<T: Encode> Encode for PropertyUpdate<T> {
77 fn scratch_len(&self) -> usize {
78 self.new_value.scratch_len()
79 }
80
81 fn encode(&self, cursor: &mut EncodeCursor) {
82 self.new_value.encode(cursor);
83 }
84}
85
86impl<'a, T: Decode<'a>> Decode<'a> for PropertyUpdate<T> {
87 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
88 let new_value = Decode::decode(cursor)?;
89
90 Ok(PropertyUpdate {
91 new_value,
92 })
93 }
94}
95
96impl<'a, T: Owned> BaseLen for PropertyUpdateLazy<'a, T> {
97 const BASE_LEN: usize = T::BASE_LEN;
98}
99
100impl<'a, T: Owned> Encode for PropertyUpdateLazy<'a, T> {
101 fn scratch_len(&self) -> usize {
102 let new_value: T::Lazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
103 new_value.scratch_len()
104 }
105
106 fn encode(&self, cursor: &mut EncodeCursor) {
107 let new_value: T::Lazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
108 new_value.encode(cursor);
109 }
110}
111
112impl<'a, T: Owned> Decode<'a> for PropertyUpdateLazy<'a, T> {
113 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
114 let offset = cursor.offset();
115 cursor.advance(Self::BASE_LEN);
116 Ok(PropertyUpdateLazy {
117 buffer: cursor.buffer(),
118 offset,
119 _t: core::marker::PhantomData,
120 })
121 }
122}
123
124impl<'a, T: Owned> TryFrom<PropertyUpdateLazy<'a, T>> for PropertyUpdate<T> {
125 type Error = DecodeError;
126
127 fn try_from(other: PropertyUpdateLazy<'a, T>) -> Result<Self, Self::Error> {
128 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
129 Decode::decode(&cursor)
130 }
131}
132
133impl<'a, T> Copy for PropertyUpdateLazy<'a, T> { }
134
135impl<'a, T> Clone for PropertyUpdateLazy<'a, T> {
136 fn clone(&self) -> Self {
137 Self {
138 buffer: self.buffer,
139 offset: self.offset,
140 _t: core::marker::PhantomData,
141 }
142 }
143}
144
145impl<'a, T> core::fmt::Debug for PropertyUpdateLazy<'a, T> {
146 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
147 f.debug_struct("PropertyUpdateLazy")
148 .finish()
149 }
150}
151
152impl<'a, T: Owned> PartialEq for PropertyUpdateLazy<'a, T> {
153 fn eq(&self, other: &Self) -> bool {
154 self.new_value().unwrap() == other.new_value().unwrap()
155 }
156}
157
158#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)]
159pub struct Request<T> {
160 pub request_id: u32,
161 pub worker: u16,
162 pub payload: T,
163}
164
165pub struct RequestLazy<'a, T> {
166 buffer: &'a [u8],
167 offset: usize,
168 _t: core::marker::PhantomData<T>,
169}
170
171pub struct RequestGen<
172 Payload: Encode,
173> {
174 pub request_id: u32,
175 pub worker: u16,
176 pub payload: Payload,
177}
178
179impl<
180 T: Owned,
181 Payload: Encode + Compatible<T>
182> Compatible<Request<T>> for RequestGen<Payload> { }
183impl<
184 T: Owned,
185 Payload: Encode + Compatible<T>
186> Compatible<RequestGen<Payload>> for Request<T> { }
187
188impl<
189 Payload: Encode,
190> BaseLen for RequestGen<Payload> {
191 const BASE_LEN: usize = 6 + Payload::BASE_LEN;
192}
193
194impl<
195 Payload: Encode,
196> Encode for RequestGen<Payload> {
197 fn scratch_len(&self) -> usize {
198 self.request_id.scratch_len() + self.worker.scratch_len() + self.payload.scratch_len()
199 }
200
201 fn encode(&self, cursor: &mut EncodeCursor) {
202 self.request_id.encode(cursor);
203 self.worker.encode(cursor);
204 self.payload.encode(cursor);
205 }
206}
207
208impl<T: Owned> Owned for Request<T> {
209 type Lazy<'a> = RequestLazy<'a, T>;
210
211 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
212 TryFrom::try_from(lazy)
213 }
214}
215
216impl<'a, T: Owned> Lazy<'a> for RequestLazy<'a, T> {
217 type Owned = Request<T>;
218}
219
220impl<'a, T: Owned> Compatible<RequestLazy<'a, T>> for RequestLazy<'a, T> { }
221impl<'a, T: Owned> Compatible<RequestLazy<'a, T>> for Request<T> { }
222impl<T: Owned> Compatible<Request<T>> for Request<T> { }
223impl<'a, T: Owned> Compatible<Request<T>> for RequestLazy<'a, T> { }
224
225impl<'a, T: Owned> RequestLazy<'a, T> {
226
227 pub fn request_id(&self) -> DecodeResult<u32> {
228 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0))
229 }
230
231 pub fn worker(&self) -> DecodeResult<u16> {
232 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 4))
233 }
234
235 pub fn payload(&self) -> DecodeResult<T::Lazy<'a>> {
236 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 6))
237 }
238}
239
240impl<T: BaseLen> BaseLen for Request<T> {
241 const BASE_LEN: usize = 6 + T::BASE_LEN;
242}
243
244impl<T: Encode> Encode for Request<T> {
245 fn scratch_len(&self) -> usize {
246 self.request_id.scratch_len() + self.worker.scratch_len() + self.payload.scratch_len()
247 }
248
249 fn encode(&self, cursor: &mut EncodeCursor) {
250 self.request_id.encode(cursor);
251 self.worker.encode(cursor);
252 self.payload.encode(cursor);
253 }
254}
255
256impl<'a, T: Decode<'a>> Decode<'a> for Request<T> {
257 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
258 let request_id = Decode::decode(cursor)?;
259 let worker = Decode::decode(cursor)?;
260 let payload = Decode::decode(cursor)?;
261
262 Ok(Request {
263 request_id,
264 worker,
265 payload,
266 })
267 }
268}
269
270impl<'a, T: Owned> BaseLen for RequestLazy<'a, T> {
271 const BASE_LEN: usize = 6 + T::BASE_LEN;
272}
273
274impl<'a, T: Owned> Encode for RequestLazy<'a, T> {
275 fn scratch_len(&self) -> usize {
276 let request_id: u32 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
277 let worker: u16 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 4)).unwrap();
278 let payload: T::Lazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 6)).unwrap();
279 request_id.scratch_len() + worker.scratch_len() + payload.scratch_len()
280 }
281
282 fn encode(&self, cursor: &mut EncodeCursor) {
283 let request_id: u32 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
284 let worker: u16 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 4)).unwrap();
285 let payload: T::Lazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 6)).unwrap();
286 request_id.encode(cursor);
287 worker.encode(cursor);
288 payload.encode(cursor);
289 }
290}
291
292impl<'a, T: Owned> Decode<'a> for RequestLazy<'a, T> {
293 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
294 let offset = cursor.offset();
295 cursor.advance(Self::BASE_LEN);
296 Ok(RequestLazy {
297 buffer: cursor.buffer(),
298 offset,
299 _t: core::marker::PhantomData,
300 })
301 }
302}
303
304impl<'a, T: Owned> TryFrom<RequestLazy<'a, T>> for Request<T> {
305 type Error = DecodeError;
306
307 fn try_from(other: RequestLazy<'a, T>) -> Result<Self, Self::Error> {
308 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
309 Decode::decode(&cursor)
310 }
311}
312
313impl<'a, T> Copy for RequestLazy<'a, T> { }
314
315impl<'a, T> Clone for RequestLazy<'a, T> {
316 fn clone(&self) -> Self {
317 Self {
318 buffer: self.buffer,
319 offset: self.offset,
320 _t: core::marker::PhantomData,
321 }
322 }
323}
324
325impl<'a, T> core::fmt::Debug for RequestLazy<'a, T> {
326 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
327 f.debug_struct("RequestLazy")
328 .finish()
329 }
330}
331
332impl<'a, T: Owned> PartialEq for RequestLazy<'a, T> {
333 fn eq(&self, other: &Self) -> bool {
334 self.request_id().unwrap() == other.request_id().unwrap()
335 && self.worker().unwrap() == other.worker().unwrap()&& self.payload().unwrap() == other.payload().unwrap()
336 }
337}
338
339#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)]
340pub struct Response<T> {
341 pub request_id: u32,
342 pub requester: u64,
343 pub requester_worker: u16,
344 pub payload: T,
345}
346
347pub struct ResponseLazy<'a, T> {
348 buffer: &'a [u8],
349 offset: usize,
350 _t: core::marker::PhantomData<T>,
351}
352
353pub struct ResponseGen<
354 Payload: Encode,
355> {
356 pub request_id: u32,
357 pub requester: u64,
358 pub requester_worker: u16,
359 pub payload: Payload,
360}
361
362impl<
363 T: Owned,
364 Payload: Encode + Compatible<T>
365> Compatible<Response<T>> for ResponseGen<Payload> { }
366impl<
367 T: Owned,
368 Payload: Encode + Compatible<T>
369> Compatible<ResponseGen<Payload>> for Response<T> { }
370
371impl<
372 Payload: Encode,
373> BaseLen for ResponseGen<Payload> {
374 const BASE_LEN: usize = 14 + Payload::BASE_LEN;
375}
376
377impl<
378 Payload: Encode,
379> Encode for ResponseGen<Payload> {
380 fn scratch_len(&self) -> usize {
381 self.request_id.scratch_len() + self.requester.scratch_len() + self.requester_worker.scratch_len() + self.payload.scratch_len()
382 }
383
384 fn encode(&self, cursor: &mut EncodeCursor) {
385 self.request_id.encode(cursor);
386 self.requester.encode(cursor);
387 self.requester_worker.encode(cursor);
388 self.payload.encode(cursor);
389 }
390}
391
392impl<T: Owned> Owned for Response<T> {
393 type Lazy<'a> = ResponseLazy<'a, T>;
394
395 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
396 TryFrom::try_from(lazy)
397 }
398}
399
400impl<'a, T: Owned> Lazy<'a> for ResponseLazy<'a, T> {
401 type Owned = Response<T>;
402}
403
404impl<'a, T: Owned> Compatible<ResponseLazy<'a, T>> for ResponseLazy<'a, T> { }
405impl<'a, T: Owned> Compatible<ResponseLazy<'a, T>> for Response<T> { }
406impl<T: Owned> Compatible<Response<T>> for Response<T> { }
407impl<'a, T: Owned> Compatible<Response<T>> for ResponseLazy<'a, T> { }
408
409impl<'a, T: Owned> ResponseLazy<'a, T> {
410
411 pub fn request_id(&self) -> DecodeResult<u32> {
412 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0))
413 }
414
415 pub fn requester(&self) -> DecodeResult<u64> {
416 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 4))
417 }
418
419 pub fn requester_worker(&self) -> DecodeResult<u16> {
420 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 12))
421 }
422
423 pub fn payload(&self) -> DecodeResult<T::Lazy<'a>> {
424 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 14))
425 }
426}
427
428impl<T: BaseLen> BaseLen for Response<T> {
429 const BASE_LEN: usize = 14 + T::BASE_LEN;
430}
431
432impl<T: Encode> Encode for Response<T> {
433 fn scratch_len(&self) -> usize {
434 self.request_id.scratch_len() + self.requester.scratch_len() + self.requester_worker.scratch_len() + self.payload.scratch_len()
435 }
436
437 fn encode(&self, cursor: &mut EncodeCursor) {
438 self.request_id.encode(cursor);
439 self.requester.encode(cursor);
440 self.requester_worker.encode(cursor);
441 self.payload.encode(cursor);
442 }
443}
444
445impl<'a, T: Decode<'a>> Decode<'a> for Response<T> {
446 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
447 let request_id = Decode::decode(cursor)?;
448 let requester = Decode::decode(cursor)?;
449 let requester_worker = Decode::decode(cursor)?;
450 let payload = Decode::decode(cursor)?;
451
452 Ok(Response {
453 request_id,
454 requester,
455 requester_worker,
456 payload,
457 })
458 }
459}
460
461impl<'a, T: Owned> BaseLen for ResponseLazy<'a, T> {
462 const BASE_LEN: usize = 14 + T::BASE_LEN;
463}
464
465impl<'a, T: Owned> Encode for ResponseLazy<'a, T> {
466 fn scratch_len(&self) -> usize {
467 let request_id: u32 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
468 let requester: u64 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 4)).unwrap();
469 let requester_worker: u16 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 12)).unwrap();
470 let payload: T::Lazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 14)).unwrap();
471 request_id.scratch_len() + requester.scratch_len() + requester_worker.scratch_len() + payload.scratch_len()
472 }
473
474 fn encode(&self, cursor: &mut EncodeCursor) {
475 let request_id: u32 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
476 let requester: u64 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 4)).unwrap();
477 let requester_worker: u16 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 12)).unwrap();
478 let payload: T::Lazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 14)).unwrap();
479 request_id.encode(cursor);
480 requester.encode(cursor);
481 requester_worker.encode(cursor);
482 payload.encode(cursor);
483 }
484}
485
486impl<'a, T: Owned> Decode<'a> for ResponseLazy<'a, T> {
487 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
488 let offset = cursor.offset();
489 cursor.advance(Self::BASE_LEN);
490 Ok(ResponseLazy {
491 buffer: cursor.buffer(),
492 offset,
493 _t: core::marker::PhantomData,
494 })
495 }
496}
497
498impl<'a, T: Owned> TryFrom<ResponseLazy<'a, T>> for Response<T> {
499 type Error = DecodeError;
500
501 fn try_from(other: ResponseLazy<'a, T>) -> Result<Self, Self::Error> {
502 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
503 Decode::decode(&cursor)
504 }
505}
506
507impl<'a, T> Copy for ResponseLazy<'a, T> { }
508
509impl<'a, T> Clone for ResponseLazy<'a, T> {
510 fn clone(&self) -> Self {
511 Self {
512 buffer: self.buffer,
513 offset: self.offset,
514 _t: core::marker::PhantomData,
515 }
516 }
517}
518
519impl<'a, T> core::fmt::Debug for ResponseLazy<'a, T> {
520 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
521 f.debug_struct("ResponseLazy")
522 .finish()
523 }
524}
525
526impl<'a, T: Owned> PartialEq for ResponseLazy<'a, T> {
527 fn eq(&self, other: &Self) -> bool {
528 self.request_id().unwrap() == other.request_id().unwrap()
529 && self.requester().unwrap() == other.requester().unwrap()&& self.requester_worker().unwrap() == other.requester_worker().unwrap()&& self.payload().unwrap() == other.payload().unwrap()
530 }
531}
532
533#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)]
534pub struct StreamItem<T> {
535 pub seq: u64,
536 pub payload: T,
537}
538
539pub struct StreamItemLazy<'a, T> {
540 buffer: &'a [u8],
541 offset: usize,
542 _t: core::marker::PhantomData<T>,
543}
544
545pub struct StreamItemGen<
546 Payload: Encode,
547> {
548 pub seq: u64,
549 pub payload: Payload,
550}
551
552impl<
553 T: Owned,
554 Payload: Encode + Compatible<T>
555> Compatible<StreamItem<T>> for StreamItemGen<Payload> { }
556impl<
557 T: Owned,
558 Payload: Encode + Compatible<T>
559> Compatible<StreamItemGen<Payload>> for StreamItem<T> { }
560
561impl<
562 Payload: Encode,
563> BaseLen for StreamItemGen<Payload> {
564 const BASE_LEN: usize = 8 + Payload::BASE_LEN;
565}
566
567impl<
568 Payload: Encode,
569> Encode for StreamItemGen<Payload> {
570 fn scratch_len(&self) -> usize {
571 self.seq.scratch_len() + self.payload.scratch_len()
572 }
573
574 fn encode(&self, cursor: &mut EncodeCursor) {
575 self.seq.encode(cursor);
576 self.payload.encode(cursor);
577 }
578}
579
580impl<T: Owned> Owned for StreamItem<T> {
581 type Lazy<'a> = StreamItemLazy<'a, T>;
582
583 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
584 TryFrom::try_from(lazy)
585 }
586}
587
588impl<'a, T: Owned> Lazy<'a> for StreamItemLazy<'a, T> {
589 type Owned = StreamItem<T>;
590}
591
592impl<'a, T: Owned> Compatible<StreamItemLazy<'a, T>> for StreamItemLazy<'a, T> { }
593impl<'a, T: Owned> Compatible<StreamItemLazy<'a, T>> for StreamItem<T> { }
594impl<T: Owned> Compatible<StreamItem<T>> for StreamItem<T> { }
595impl<'a, T: Owned> Compatible<StreamItem<T>> for StreamItemLazy<'a, T> { }
596
597impl<'a, T: Owned> StreamItemLazy<'a, T> {
598
599 pub fn seq(&self) -> DecodeResult<u64> {
600 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0))
601 }
602
603 pub fn payload(&self) -> DecodeResult<T::Lazy<'a>> {
604 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 8))
605 }
606}
607
608impl<T: BaseLen> BaseLen for StreamItem<T> {
609 const BASE_LEN: usize = 8 + T::BASE_LEN;
610}
611
612impl<T: Encode> Encode for StreamItem<T> {
613 fn scratch_len(&self) -> usize {
614 self.seq.scratch_len() + self.payload.scratch_len()
615 }
616
617 fn encode(&self, cursor: &mut EncodeCursor) {
618 self.seq.encode(cursor);
619 self.payload.encode(cursor);
620 }
621}
622
623impl<'a, T: Decode<'a>> Decode<'a> for StreamItem<T> {
624 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
625 let seq = Decode::decode(cursor)?;
626 let payload = Decode::decode(cursor)?;
627
628 Ok(StreamItem {
629 seq,
630 payload,
631 })
632 }
633}
634
635impl<'a, T: Owned> BaseLen for StreamItemLazy<'a, T> {
636 const BASE_LEN: usize = 8 + T::BASE_LEN;
637}
638
639impl<'a, T: Owned> Encode for StreamItemLazy<'a, T> {
640 fn scratch_len(&self) -> usize {
641 let seq: u64 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
642 let payload: T::Lazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 8)).unwrap();
643 seq.scratch_len() + payload.scratch_len()
644 }
645
646 fn encode(&self, cursor: &mut EncodeCursor) {
647 let seq: u64 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
648 let payload: T::Lazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 8)).unwrap();
649 seq.encode(cursor);
650 payload.encode(cursor);
651 }
652}
653
654impl<'a, T: Owned> Decode<'a> for StreamItemLazy<'a, T> {
655 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
656 let offset = cursor.offset();
657 cursor.advance(Self::BASE_LEN);
658 Ok(StreamItemLazy {
659 buffer: cursor.buffer(),
660 offset,
661 _t: core::marker::PhantomData,
662 })
663 }
664}
665
666impl<'a, T: Owned> TryFrom<StreamItemLazy<'a, T>> for StreamItem<T> {
667 type Error = DecodeError;
668
669 fn try_from(other: StreamItemLazy<'a, T>) -> Result<Self, Self::Error> {
670 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
671 Decode::decode(&cursor)
672 }
673}
674
675impl<'a, T> Copy for StreamItemLazy<'a, T> { }
676
677impl<'a, T> Clone for StreamItemLazy<'a, T> {
678 fn clone(&self) -> Self {
679 Self {
680 buffer: self.buffer,
681 offset: self.offset,
682 _t: core::marker::PhantomData,
683 }
684 }
685}
686
687impl<'a, T> core::fmt::Debug for StreamItemLazy<'a, T> {
688 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
689 f.debug_struct("StreamItemLazy")
690 .finish()
691 }
692}
693
694impl<'a, T: Owned> PartialEq for StreamItemLazy<'a, T> {
695 fn eq(&self, other: &Self) -> bool {
696 self.seq().unwrap() == other.seq().unwrap()
697 && self.payload().unwrap() == other.payload().unwrap()
698 }
699}
700
701#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)]
702pub struct MultiStreamId {
703 pub owner: u64,
704 pub id: u32,
705}
706
707pub struct MultiStreamIdLazy<'a> {
708 buffer: &'a [u8],
709 offset: usize,
710}
711
712pub struct MultiStreamIdGen<> {
713 pub owner: u64,
714 pub id: u32,
715}
716
717impl<> Compatible<MultiStreamId> for MultiStreamIdGen<> { }
718impl<> Compatible<MultiStreamIdGen<>> for MultiStreamId { }
719
720impl<> BaseLen for MultiStreamIdGen<> {
721 const BASE_LEN: usize = 12;
722}
723
724impl<> Encode for MultiStreamIdGen<> {
725 fn scratch_len(&self) -> usize {
726 self.owner.scratch_len() + self.id.scratch_len()
727 }
728
729 fn encode(&self, cursor: &mut EncodeCursor) {
730 self.owner.encode(cursor);
731 self.id.encode(cursor);
732 }
733}
734
735impl Owned for MultiStreamId {
736 type Lazy<'a> = MultiStreamIdLazy<'a>;
737
738 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
739 TryFrom::try_from(lazy)
740 }
741}
742
743impl<'a> Lazy<'a> for MultiStreamIdLazy<'a> {
744 type Owned = MultiStreamId;
745}
746
747impl<'a> Compatible<MultiStreamIdLazy<'a>> for MultiStreamIdLazy<'a> { }
748impl<'a> Compatible<MultiStreamIdLazy<'a>> for MultiStreamId { }
749impl Compatible<MultiStreamId> for MultiStreamId { }
750impl<'a> Compatible<MultiStreamId> for MultiStreamIdLazy<'a> { }
751
752impl<'a> MultiStreamIdLazy<'a> {
753
754 pub fn owner(&self) -> DecodeResult<u64> {
755 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0))
756 }
757
758 pub fn id(&self) -> DecodeResult<u32> {
759 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 8))
760 }
761}
762
763impl BaseLen for MultiStreamId {
764 const BASE_LEN: usize = 12;
765}
766
767impl Encode for MultiStreamId {
768 fn scratch_len(&self) -> usize {
769 self.owner.scratch_len() + self.id.scratch_len()
770 }
771
772 fn encode(&self, cursor: &mut EncodeCursor) {
773 self.owner.encode(cursor);
774 self.id.encode(cursor);
775 }
776}
777
778impl<'a> Decode<'a> for MultiStreamId {
779 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
780 let owner = Decode::decode(cursor)?;
781 let id = Decode::decode(cursor)?;
782
783 Ok(MultiStreamId {
784 owner,
785 id,
786 })
787 }
788}
789
790impl<'a> BaseLen for MultiStreamIdLazy<'a> {
791 const BASE_LEN: usize = 12;
792}
793
794impl<'a> Encode for MultiStreamIdLazy<'a> {
795 fn scratch_len(&self) -> usize {
796 let owner: u64 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
797 let id: u32 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 8)).unwrap();
798 owner.scratch_len() + id.scratch_len()
799 }
800
801 fn encode(&self, cursor: &mut EncodeCursor) {
802 let owner: u64 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
803 let id: u32 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 8)).unwrap();
804 owner.encode(cursor);
805 id.encode(cursor);
806 }
807}
808
809impl<'a> Decode<'a> for MultiStreamIdLazy<'a> {
810 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
811 let offset = cursor.offset();
812 cursor.advance(Self::BASE_LEN);
813 Ok(MultiStreamIdLazy {
814 buffer: cursor.buffer(),
815 offset,
816 })
817 }
818}
819
820impl<'a> TryFrom<MultiStreamIdLazy<'a>> for MultiStreamId {
821 type Error = DecodeError;
822
823 fn try_from(other: MultiStreamIdLazy<'a>) -> Result<Self, Self::Error> {
824 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
825 Decode::decode(&cursor)
826 }
827}
828
829impl<'a> Copy for MultiStreamIdLazy<'a> { }
830
831impl<'a> Clone for MultiStreamIdLazy<'a> {
832 fn clone(&self) -> Self {
833 Self {
834 buffer: self.buffer,
835 offset: self.offset,
836 }
837 }
838}
839
840impl<'a> core::fmt::Debug for MultiStreamIdLazy<'a> {
841 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
842 f.debug_struct("MultiStreamIdLazy")
843 .finish()
844 }
845}
846
847impl<'a> PartialEq for MultiStreamIdLazy<'a> {
848 fn eq(&self, other: &Self) -> bool {
849 self.owner().unwrap() == other.owner().unwrap()
850 && self.id().unwrap() == other.id().unwrap()
851 }
852}
853
854#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)]
855pub struct MultiStreamItem<T> {
856 pub stream_id: MultiStreamId,
857 pub seq: u64,
858 pub payload: Option<T>,
859}
860
861pub struct MultiStreamItemLazy<'a, T> {
862 buffer: &'a [u8],
863 offset: usize,
864 _t: core::marker::PhantomData<T>,
865}
866
867pub struct MultiStreamItemGen<
868 StreamId: Encode + Compatible<MultiStreamId>,
869 Payload: Encode,
870> {
871 pub stream_id: StreamId,
872 pub seq: u64,
873 pub payload: Payload,
874}
875
876impl<
877 T: Owned,
878 StreamId: Encode + Compatible<MultiStreamId>,
879 Payload: Encode + Compatible<Option<T>>
880> Compatible<MultiStreamItem<T>> for MultiStreamItemGen<StreamId, Payload> { }
881impl<
882 T: Owned,
883 StreamId: Encode + Compatible<MultiStreamId>,
884 Payload: Encode + Compatible<Option<T>>
885> Compatible<MultiStreamItemGen<StreamId, Payload>> for MultiStreamItem<T> { }
886
887impl<
888 StreamId: Encode + Compatible<MultiStreamId>,
889 Payload: Encode,
890> BaseLen for MultiStreamItemGen<StreamId, Payload> {
891 const BASE_LEN: usize = 8 + StreamId::BASE_LEN + Payload::BASE_LEN;
892}
893
894impl<
895 StreamId: Encode + Compatible<MultiStreamId>,
896 Payload: Encode,
897> Encode for MultiStreamItemGen<StreamId, Payload> {
898 fn scratch_len(&self) -> usize {
899 self.stream_id.scratch_len() + self.seq.scratch_len() + self.payload.scratch_len()
900 }
901
902 fn encode(&self, cursor: &mut EncodeCursor) {
903 self.stream_id.encode(cursor);
904 self.seq.encode(cursor);
905 self.payload.encode(cursor);
906 }
907}
908
909impl<T: Owned> Owned for MultiStreamItem<T> {
910 type Lazy<'a> = MultiStreamItemLazy<'a, T>;
911
912 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
913 TryFrom::try_from(lazy)
914 }
915}
916
917impl<'a, T: Owned> Lazy<'a> for MultiStreamItemLazy<'a, T> {
918 type Owned = MultiStreamItem<T>;
919}
920
921impl<'a, T: Owned> Compatible<MultiStreamItemLazy<'a, T>> for MultiStreamItemLazy<'a, T> { }
922impl<'a, T: Owned> Compatible<MultiStreamItemLazy<'a, T>> for MultiStreamItem<T> { }
923impl<T: Owned> Compatible<MultiStreamItem<T>> for MultiStreamItem<T> { }
924impl<'a, T: Owned> Compatible<MultiStreamItem<T>> for MultiStreamItemLazy<'a, T> { }
925
926impl<'a, T: Owned> MultiStreamItemLazy<'a, T> {
927
928 pub fn stream_id(&self) -> DecodeResult<MultiStreamIdLazy<'a>> {
929 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0))
930 }
931
932 pub fn seq(&self) -> DecodeResult<u64> {
933 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 12))
934 }
935
936 pub fn payload(&self) -> DecodeResult<Option<T::Lazy<'a>>> {
937 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 20))
938 }
939}
940
941impl<T: BaseLen> BaseLen for MultiStreamItem<T> {
942 const BASE_LEN: usize = 21 + T::BASE_LEN;
943}
944
945impl<T: Encode> Encode for MultiStreamItem<T> {
946 fn scratch_len(&self) -> usize {
947 self.stream_id.scratch_len() + self.seq.scratch_len() + self.payload.scratch_len()
948 }
949
950 fn encode(&self, cursor: &mut EncodeCursor) {
951 self.stream_id.encode(cursor);
952 self.seq.encode(cursor);
953 self.payload.encode(cursor);
954 }
955}
956
957impl<'a, T: Decode<'a>> Decode<'a> for MultiStreamItem<T> {
958 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
959 let stream_id = Decode::decode(cursor)?;
960 let seq = Decode::decode(cursor)?;
961 let payload = Decode::decode(cursor)?;
962
963 Ok(MultiStreamItem {
964 stream_id,
965 seq,
966 payload,
967 })
968 }
969}
970
971impl<'a, T: Owned> BaseLen for MultiStreamItemLazy<'a, T> {
972 const BASE_LEN: usize = 21 + T::BASE_LEN;
973}
974
975impl<'a, T: Owned> Encode for MultiStreamItemLazy<'a, T> {
976 fn scratch_len(&self) -> usize {
977 let stream_id: MultiStreamIdLazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
978 let seq: u64 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 12)).unwrap();
979 let payload: Option<T::Lazy<'a>> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 20)).unwrap();
980 stream_id.scratch_len() + seq.scratch_len() + payload.scratch_len()
981 }
982
983 fn encode(&self, cursor: &mut EncodeCursor) {
984 let stream_id: MultiStreamIdLazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
985 let seq: u64 = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 12)).unwrap();
986 let payload: Option<T::Lazy<'a>> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 20)).unwrap();
987 stream_id.encode(cursor);
988 seq.encode(cursor);
989 payload.encode(cursor);
990 }
991}
992
993impl<'a, T: Owned> Decode<'a> for MultiStreamItemLazy<'a, T> {
994 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
995 let offset = cursor.offset();
996 cursor.advance(Self::BASE_LEN);
997 Ok(MultiStreamItemLazy {
998 buffer: cursor.buffer(),
999 offset,
1000 _t: core::marker::PhantomData,
1001 })
1002 }
1003}
1004
1005impl<'a, T: Owned> TryFrom<MultiStreamItemLazy<'a, T>> for MultiStreamItem<T> {
1006 type Error = DecodeError;
1007
1008 fn try_from(other: MultiStreamItemLazy<'a, T>) -> Result<Self, Self::Error> {
1009 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
1010 Decode::decode(&cursor)
1011 }
1012}
1013
1014impl<'a, T> Copy for MultiStreamItemLazy<'a, T> { }
1015
1016impl<'a, T> Clone for MultiStreamItemLazy<'a, T> {
1017 fn clone(&self) -> Self {
1018 Self {
1019 buffer: self.buffer,
1020 offset: self.offset,
1021 _t: core::marker::PhantomData,
1022 }
1023 }
1024}
1025
1026impl<'a, T> core::fmt::Debug for MultiStreamItemLazy<'a, T> {
1027 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1028 f.debug_struct("MultiStreamItemLazy")
1029 .finish()
1030 }
1031}
1032
1033impl<'a, T: Owned> PartialEq for MultiStreamItemLazy<'a, T> {
1034 fn eq(&self, other: &Self) -> bool {
1035 self.stream_id().unwrap() == other.stream_id().unwrap()
1036 && self.seq().unwrap() == other.seq().unwrap()&& self.payload().unwrap() == other.payload().unwrap()
1037 }
1038}
1039
1040#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)]
1041pub struct PropertyInitState<T> {
1042 pub value: T,
1043}
1044
1045pub struct PropertyInitStateLazy<'a, T> {
1046 buffer: &'a [u8],
1047 offset: usize,
1048 _t: core::marker::PhantomData<T>,
1049}
1050
1051pub struct PropertyInitStateGen<
1052 Value: Encode,
1053> {
1054 pub value: Value,
1055}
1056
1057impl<
1058 T: Owned,
1059 Value: Encode + Compatible<T>
1060> Compatible<PropertyInitState<T>> for PropertyInitStateGen<Value> { }
1061impl<
1062 T: Owned,
1063 Value: Encode + Compatible<T>
1064> Compatible<PropertyInitStateGen<Value>> for PropertyInitState<T> { }
1065
1066impl<
1067 Value: Encode,
1068> BaseLen for PropertyInitStateGen<Value> {
1069 const BASE_LEN: usize = Value::BASE_LEN;
1070}
1071
1072impl<
1073 Value: Encode,
1074> Encode for PropertyInitStateGen<Value> {
1075 fn scratch_len(&self) -> usize {
1076 self.value.scratch_len()
1077 }
1078
1079 fn encode(&self, cursor: &mut EncodeCursor) {
1080 self.value.encode(cursor);
1081 }
1082}
1083
1084impl<T: Owned> Owned for PropertyInitState<T> {
1085 type Lazy<'a> = PropertyInitStateLazy<'a, T>;
1086
1087 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
1088 TryFrom::try_from(lazy)
1089 }
1090}
1091
1092impl<'a, T: Owned> Lazy<'a> for PropertyInitStateLazy<'a, T> {
1093 type Owned = PropertyInitState<T>;
1094}
1095
1096impl<'a, T: Owned> Compatible<PropertyInitStateLazy<'a, T>> for PropertyInitStateLazy<'a, T> { }
1097impl<'a, T: Owned> Compatible<PropertyInitStateLazy<'a, T>> for PropertyInitState<T> { }
1098impl<T: Owned> Compatible<PropertyInitState<T>> for PropertyInitState<T> { }
1099impl<'a, T: Owned> Compatible<PropertyInitState<T>> for PropertyInitStateLazy<'a, T> { }
1100
1101impl<'a, T: Owned> PropertyInitStateLazy<'a, T> {
1102
1103 pub fn value(&self) -> DecodeResult<T::Lazy<'a>> {
1104 Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0))
1105 }
1106}
1107
1108impl<T: BaseLen> BaseLen for PropertyInitState<T> {
1109 const BASE_LEN: usize = T::BASE_LEN;
1110}
1111
1112impl<T: Encode> Encode for PropertyInitState<T> {
1113 fn scratch_len(&self) -> usize {
1114 self.value.scratch_len()
1115 }
1116
1117 fn encode(&self, cursor: &mut EncodeCursor) {
1118 self.value.encode(cursor);
1119 }
1120}
1121
1122impl<'a, T: Decode<'a>> Decode<'a> for PropertyInitState<T> {
1123 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
1124 let value = Decode::decode(cursor)?;
1125
1126 Ok(PropertyInitState {
1127 value,
1128 })
1129 }
1130}
1131
1132impl<'a, T: Owned> BaseLen for PropertyInitStateLazy<'a, T> {
1133 const BASE_LEN: usize = T::BASE_LEN;
1134}
1135
1136impl<'a, T: Owned> Encode for PropertyInitStateLazy<'a, T> {
1137 fn scratch_len(&self) -> usize {
1138 let value: T::Lazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
1139 value.scratch_len()
1140 }
1141
1142 fn encode(&self, cursor: &mut EncodeCursor) {
1143 let value: T::Lazy<'a> = Decode::decode(&DecodeCursor::at_offset(self.buffer, self.offset + 0)).unwrap();
1144 value.encode(cursor);
1145 }
1146}
1147
1148impl<'a, T: Owned> Decode<'a> for PropertyInitStateLazy<'a, T> {
1149 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
1150 let offset = cursor.offset();
1151 cursor.advance(Self::BASE_LEN);
1152 Ok(PropertyInitStateLazy {
1153 buffer: cursor.buffer(),
1154 offset,
1155 _t: core::marker::PhantomData,
1156 })
1157 }
1158}
1159
1160impl<'a, T: Owned> TryFrom<PropertyInitStateLazy<'a, T>> for PropertyInitState<T> {
1161 type Error = DecodeError;
1162
1163 fn try_from(other: PropertyInitStateLazy<'a, T>) -> Result<Self, Self::Error> {
1164 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
1165 Decode::decode(&cursor)
1166 }
1167}
1168
1169impl<'a, T> Copy for PropertyInitStateLazy<'a, T> { }
1170
1171impl<'a, T> Clone for PropertyInitStateLazy<'a, T> {
1172 fn clone(&self) -> Self {
1173 Self {
1174 buffer: self.buffer,
1175 offset: self.offset,
1176 _t: core::marker::PhantomData,
1177 }
1178 }
1179}
1180
1181impl<'a, T> core::fmt::Debug for PropertyInitStateLazy<'a, T> {
1182 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1183 f.debug_struct("PropertyInitStateLazy")
1184 .finish()
1185 }
1186}
1187
1188impl<'a, T: Owned> PartialEq for PropertyInitStateLazy<'a, T> {
1189 fn eq(&self, other: &Self) -> bool {
1190 self.value().unwrap() == other.value().unwrap()
1191 }
1192}
1193
1194#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
1195pub struct PropertyObserverConfig {}
1196
1197pub struct PropertyObserverConfigLazy<'a> {
1198 buffer: &'a [u8],
1199 offset: usize,
1200}
1201
1202pub struct PropertyObserverConfigGen<> {}
1203
1204impl<> Compatible<PropertyObserverConfig> for PropertyObserverConfigGen<> { }
1205impl<> Compatible<PropertyObserverConfigGen<>> for PropertyObserverConfig { }
1206
1207impl<> BaseLen for PropertyObserverConfigGen<> {
1208 const BASE_LEN: usize = 0;
1209}
1210
1211impl<> Encode for PropertyObserverConfigGen<> {
1212 fn scratch_len(&self) -> usize {
1213 0
1214 }
1215
1216 fn encode(&self, _: &mut EncodeCursor) {}
1217}
1218
1219impl Owned for PropertyObserverConfig {
1220 type Lazy<'a> = PropertyObserverConfigLazy<'a>;
1221
1222 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
1223 TryFrom::try_from(lazy)
1224 }
1225}
1226
1227impl<'a> Lazy<'a> for PropertyObserverConfigLazy<'a> {
1228 type Owned = PropertyObserverConfig;
1229}
1230
1231impl<'a> Compatible<PropertyObserverConfigLazy<'a>> for PropertyObserverConfigLazy<'a> { }
1232impl<'a> Compatible<PropertyObserverConfigLazy<'a>> for PropertyObserverConfig { }
1233impl Compatible<PropertyObserverConfig> for PropertyObserverConfig { }
1234impl<'a> Compatible<PropertyObserverConfig> for PropertyObserverConfigLazy<'a> { }
1235
1236impl<'a> PropertyObserverConfigLazy<'a> {}
1237
1238impl BaseLen for PropertyObserverConfig {
1239 const BASE_LEN: usize = 0;
1240}
1241
1242impl Encode for PropertyObserverConfig {
1243 fn scratch_len(&self) -> usize {
1244 0
1245 }
1246
1247 fn encode(&self, _: &mut EncodeCursor) {}
1248}
1249
1250impl<'a> Decode<'a> for PropertyObserverConfig {
1251 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
1252
1253 Ok(PropertyObserverConfig {})
1254 }
1255}
1256
1257impl<'a> BaseLen for PropertyObserverConfigLazy<'a> {
1258 const BASE_LEN: usize = 0;
1259}
1260
1261impl<'a> Encode for PropertyObserverConfigLazy<'a> {
1262 fn scratch_len(&self) -> usize {
1263 0
1264 }
1265
1266 fn encode(&self, _: &mut EncodeCursor) {}
1267}
1268
1269impl<'a> Decode<'a> for PropertyObserverConfigLazy<'a> {
1270 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
1271 let offset = cursor.offset();
1272 cursor.advance(Self::BASE_LEN);
1273 Ok(PropertyObserverConfigLazy {
1274 buffer: cursor.buffer(),
1275 offset,
1276 })
1277 }
1278}
1279
1280impl<'a> TryFrom<PropertyObserverConfigLazy<'a>> for PropertyObserverConfig {
1281 type Error = DecodeError;
1282
1283 fn try_from(other: PropertyObserverConfigLazy<'a>) -> Result<Self, Self::Error> {
1284 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
1285 Decode::decode(&cursor)
1286 }
1287}
1288
1289impl<'a> Copy for PropertyObserverConfigLazy<'a> { }
1290
1291impl<'a> Clone for PropertyObserverConfigLazy<'a> {
1292 fn clone(&self) -> Self {
1293 Self {
1294 buffer: self.buffer,
1295 offset: self.offset,
1296 }
1297 }
1298}
1299
1300impl<'a> core::fmt::Debug for PropertyObserverConfigLazy<'a> {
1301 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1302 f.debug_struct("PropertyObserverConfigLazy")
1303 .finish()
1304 }
1305}
1306
1307impl<'a> PartialEq for PropertyObserverConfigLazy<'a> {
1308 fn eq(&self, _: &Self) -> bool {
1309 true
1310 }
1311}
1312
1313#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
1314pub struct PropertyOwnerConfig {}
1315
1316pub struct PropertyOwnerConfigLazy<'a> {
1317 buffer: &'a [u8],
1318 offset: usize,
1319}
1320
1321pub struct PropertyOwnerConfigGen<> {}
1322
1323impl<> Compatible<PropertyOwnerConfig> for PropertyOwnerConfigGen<> { }
1324impl<> Compatible<PropertyOwnerConfigGen<>> for PropertyOwnerConfig { }
1325
1326impl<> BaseLen for PropertyOwnerConfigGen<> {
1327 const BASE_LEN: usize = 0;
1328}
1329
1330impl<> Encode for PropertyOwnerConfigGen<> {
1331 fn scratch_len(&self) -> usize {
1332 0
1333 }
1334
1335 fn encode(&self, _: &mut EncodeCursor) {}
1336}
1337
1338impl Owned for PropertyOwnerConfig {
1339 type Lazy<'a> = PropertyOwnerConfigLazy<'a>;
1340
1341 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
1342 TryFrom::try_from(lazy)
1343 }
1344}
1345
1346impl<'a> Lazy<'a> for PropertyOwnerConfigLazy<'a> {
1347 type Owned = PropertyOwnerConfig;
1348}
1349
1350impl<'a> Compatible<PropertyOwnerConfigLazy<'a>> for PropertyOwnerConfigLazy<'a> { }
1351impl<'a> Compatible<PropertyOwnerConfigLazy<'a>> for PropertyOwnerConfig { }
1352impl Compatible<PropertyOwnerConfig> for PropertyOwnerConfig { }
1353impl<'a> Compatible<PropertyOwnerConfig> for PropertyOwnerConfigLazy<'a> { }
1354
1355impl<'a> PropertyOwnerConfigLazy<'a> {}
1356
1357impl BaseLen for PropertyOwnerConfig {
1358 const BASE_LEN: usize = 0;
1359}
1360
1361impl Encode for PropertyOwnerConfig {
1362 fn scratch_len(&self) -> usize {
1363 0
1364 }
1365
1366 fn encode(&self, _: &mut EncodeCursor) {}
1367}
1368
1369impl<'a> Decode<'a> for PropertyOwnerConfig {
1370 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
1371
1372 Ok(PropertyOwnerConfig {})
1373 }
1374}
1375
1376impl<'a> BaseLen for PropertyOwnerConfigLazy<'a> {
1377 const BASE_LEN: usize = 0;
1378}
1379
1380impl<'a> Encode for PropertyOwnerConfigLazy<'a> {
1381 fn scratch_len(&self) -> usize {
1382 0
1383 }
1384
1385 fn encode(&self, _: &mut EncodeCursor) {}
1386}
1387
1388impl<'a> Decode<'a> for PropertyOwnerConfigLazy<'a> {
1389 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
1390 let offset = cursor.offset();
1391 cursor.advance(Self::BASE_LEN);
1392 Ok(PropertyOwnerConfigLazy {
1393 buffer: cursor.buffer(),
1394 offset,
1395 })
1396 }
1397}
1398
1399impl<'a> TryFrom<PropertyOwnerConfigLazy<'a>> for PropertyOwnerConfig {
1400 type Error = DecodeError;
1401
1402 fn try_from(other: PropertyOwnerConfigLazy<'a>) -> Result<Self, Self::Error> {
1403 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
1404 Decode::decode(&cursor)
1405 }
1406}
1407
1408impl<'a> Copy for PropertyOwnerConfigLazy<'a> { }
1409
1410impl<'a> Clone for PropertyOwnerConfigLazy<'a> {
1411 fn clone(&self) -> Self {
1412 Self {
1413 buffer: self.buffer,
1414 offset: self.offset,
1415 }
1416 }
1417}
1418
1419impl<'a> core::fmt::Debug for PropertyOwnerConfigLazy<'a> {
1420 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1421 f.debug_struct("PropertyOwnerConfigLazy")
1422 .finish()
1423 }
1424}
1425
1426impl<'a> PartialEq for PropertyOwnerConfigLazy<'a> {
1427 fn eq(&self, _: &Self) -> bool {
1428 true
1429 }
1430}
1431
1432#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
1433pub struct RequestInitState {}
1434
1435pub struct RequestInitStateLazy<'a> {
1436 buffer: &'a [u8],
1437 offset: usize,
1438}
1439
1440pub struct RequestInitStateGen<> {}
1441
1442impl<> Compatible<RequestInitState> for RequestInitStateGen<> { }
1443impl<> Compatible<RequestInitStateGen<>> for RequestInitState { }
1444
1445impl<> BaseLen for RequestInitStateGen<> {
1446 const BASE_LEN: usize = 0;
1447}
1448
1449impl<> Encode for RequestInitStateGen<> {
1450 fn scratch_len(&self) -> usize {
1451 0
1452 }
1453
1454 fn encode(&self, _: &mut EncodeCursor) {}
1455}
1456
1457impl Owned for RequestInitState {
1458 type Lazy<'a> = RequestInitStateLazy<'a>;
1459
1460 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
1461 TryFrom::try_from(lazy)
1462 }
1463}
1464
1465impl<'a> Lazy<'a> for RequestInitStateLazy<'a> {
1466 type Owned = RequestInitState;
1467}
1468
1469impl<'a> Compatible<RequestInitStateLazy<'a>> for RequestInitStateLazy<'a> { }
1470impl<'a> Compatible<RequestInitStateLazy<'a>> for RequestInitState { }
1471impl Compatible<RequestInitState> for RequestInitState { }
1472impl<'a> Compatible<RequestInitState> for RequestInitStateLazy<'a> { }
1473
1474impl<'a> RequestInitStateLazy<'a> {}
1475
1476impl BaseLen for RequestInitState {
1477 const BASE_LEN: usize = 0;
1478}
1479
1480impl Encode for RequestInitState {
1481 fn scratch_len(&self) -> usize {
1482 0
1483 }
1484
1485 fn encode(&self, _: &mut EncodeCursor) {}
1486}
1487
1488impl<'a> Decode<'a> for RequestInitState {
1489 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
1490
1491 Ok(RequestInitState {})
1492 }
1493}
1494
1495impl<'a> BaseLen for RequestInitStateLazy<'a> {
1496 const BASE_LEN: usize = 0;
1497}
1498
1499impl<'a> Encode for RequestInitStateLazy<'a> {
1500 fn scratch_len(&self) -> usize {
1501 0
1502 }
1503
1504 fn encode(&self, _: &mut EncodeCursor) {}
1505}
1506
1507impl<'a> Decode<'a> for RequestInitStateLazy<'a> {
1508 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
1509 let offset = cursor.offset();
1510 cursor.advance(Self::BASE_LEN);
1511 Ok(RequestInitStateLazy {
1512 buffer: cursor.buffer(),
1513 offset,
1514 })
1515 }
1516}
1517
1518impl<'a> TryFrom<RequestInitStateLazy<'a>> for RequestInitState {
1519 type Error = DecodeError;
1520
1521 fn try_from(other: RequestInitStateLazy<'a>) -> Result<Self, Self::Error> {
1522 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
1523 Decode::decode(&cursor)
1524 }
1525}
1526
1527impl<'a> Copy for RequestInitStateLazy<'a> { }
1528
1529impl<'a> Clone for RequestInitStateLazy<'a> {
1530 fn clone(&self) -> Self {
1531 Self {
1532 buffer: self.buffer,
1533 offset: self.offset,
1534 }
1535 }
1536}
1537
1538impl<'a> core::fmt::Debug for RequestInitStateLazy<'a> {
1539 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1540 f.debug_struct("RequestInitStateLazy")
1541 .finish()
1542 }
1543}
1544
1545impl<'a> PartialEq for RequestInitStateLazy<'a> {
1546 fn eq(&self, _: &Self) -> bool {
1547 true
1548 }
1549}
1550
1551#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
1552pub struct RequestClientConfig {}
1553
1554pub struct RequestClientConfigLazy<'a> {
1555 buffer: &'a [u8],
1556 offset: usize,
1557}
1558
1559pub struct RequestClientConfigGen<> {}
1560
1561impl<> Compatible<RequestClientConfig> for RequestClientConfigGen<> { }
1562impl<> Compatible<RequestClientConfigGen<>> for RequestClientConfig { }
1563
1564impl<> BaseLen for RequestClientConfigGen<> {
1565 const BASE_LEN: usize = 0;
1566}
1567
1568impl<> Encode for RequestClientConfigGen<> {
1569 fn scratch_len(&self) -> usize {
1570 0
1571 }
1572
1573 fn encode(&self, _: &mut EncodeCursor) {}
1574}
1575
1576impl Owned for RequestClientConfig {
1577 type Lazy<'a> = RequestClientConfigLazy<'a>;
1578
1579 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
1580 TryFrom::try_from(lazy)
1581 }
1582}
1583
1584impl<'a> Lazy<'a> for RequestClientConfigLazy<'a> {
1585 type Owned = RequestClientConfig;
1586}
1587
1588impl<'a> Compatible<RequestClientConfigLazy<'a>> for RequestClientConfigLazy<'a> { }
1589impl<'a> Compatible<RequestClientConfigLazy<'a>> for RequestClientConfig { }
1590impl Compatible<RequestClientConfig> for RequestClientConfig { }
1591impl<'a> Compatible<RequestClientConfig> for RequestClientConfigLazy<'a> { }
1592
1593impl<'a> RequestClientConfigLazy<'a> {}
1594
1595impl BaseLen for RequestClientConfig {
1596 const BASE_LEN: usize = 0;
1597}
1598
1599impl Encode for RequestClientConfig {
1600 fn scratch_len(&self) -> usize {
1601 0
1602 }
1603
1604 fn encode(&self, _: &mut EncodeCursor) {}
1605}
1606
1607impl<'a> Decode<'a> for RequestClientConfig {
1608 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
1609
1610 Ok(RequestClientConfig {})
1611 }
1612}
1613
1614impl<'a> BaseLen for RequestClientConfigLazy<'a> {
1615 const BASE_LEN: usize = 0;
1616}
1617
1618impl<'a> Encode for RequestClientConfigLazy<'a> {
1619 fn scratch_len(&self) -> usize {
1620 0
1621 }
1622
1623 fn encode(&self, _: &mut EncodeCursor) {}
1624}
1625
1626impl<'a> Decode<'a> for RequestClientConfigLazy<'a> {
1627 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
1628 let offset = cursor.offset();
1629 cursor.advance(Self::BASE_LEN);
1630 Ok(RequestClientConfigLazy {
1631 buffer: cursor.buffer(),
1632 offset,
1633 })
1634 }
1635}
1636
1637impl<'a> TryFrom<RequestClientConfigLazy<'a>> for RequestClientConfig {
1638 type Error = DecodeError;
1639
1640 fn try_from(other: RequestClientConfigLazy<'a>) -> Result<Self, Self::Error> {
1641 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
1642 Decode::decode(&cursor)
1643 }
1644}
1645
1646impl<'a> Copy for RequestClientConfigLazy<'a> { }
1647
1648impl<'a> Clone for RequestClientConfigLazy<'a> {
1649 fn clone(&self) -> Self {
1650 Self {
1651 buffer: self.buffer,
1652 offset: self.offset,
1653 }
1654 }
1655}
1656
1657impl<'a> core::fmt::Debug for RequestClientConfigLazy<'a> {
1658 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1659 f.debug_struct("RequestClientConfigLazy")
1660 .finish()
1661 }
1662}
1663
1664impl<'a> PartialEq for RequestClientConfigLazy<'a> {
1665 fn eq(&self, _: &Self) -> bool {
1666 true
1667 }
1668}
1669
1670#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
1671pub struct RequestServerConfig {}
1672
1673pub struct RequestServerConfigLazy<'a> {
1674 buffer: &'a [u8],
1675 offset: usize,
1676}
1677
1678pub struct RequestServerConfigGen<> {}
1679
1680impl<> Compatible<RequestServerConfig> for RequestServerConfigGen<> { }
1681impl<> Compatible<RequestServerConfigGen<>> for RequestServerConfig { }
1682
1683impl<> BaseLen for RequestServerConfigGen<> {
1684 const BASE_LEN: usize = 0;
1685}
1686
1687impl<> Encode for RequestServerConfigGen<> {
1688 fn scratch_len(&self) -> usize {
1689 0
1690 }
1691
1692 fn encode(&self, _: &mut EncodeCursor) {}
1693}
1694
1695impl Owned for RequestServerConfig {
1696 type Lazy<'a> = RequestServerConfigLazy<'a>;
1697
1698 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
1699 TryFrom::try_from(lazy)
1700 }
1701}
1702
1703impl<'a> Lazy<'a> for RequestServerConfigLazy<'a> {
1704 type Owned = RequestServerConfig;
1705}
1706
1707impl<'a> Compatible<RequestServerConfigLazy<'a>> for RequestServerConfigLazy<'a> { }
1708impl<'a> Compatible<RequestServerConfigLazy<'a>> for RequestServerConfig { }
1709impl Compatible<RequestServerConfig> for RequestServerConfig { }
1710impl<'a> Compatible<RequestServerConfig> for RequestServerConfigLazy<'a> { }
1711
1712impl<'a> RequestServerConfigLazy<'a> {}
1713
1714impl BaseLen for RequestServerConfig {
1715 const BASE_LEN: usize = 0;
1716}
1717
1718impl Encode for RequestServerConfig {
1719 fn scratch_len(&self) -> usize {
1720 0
1721 }
1722
1723 fn encode(&self, _: &mut EncodeCursor) {}
1724}
1725
1726impl<'a> Decode<'a> for RequestServerConfig {
1727 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
1728
1729 Ok(RequestServerConfig {})
1730 }
1731}
1732
1733impl<'a> BaseLen for RequestServerConfigLazy<'a> {
1734 const BASE_LEN: usize = 0;
1735}
1736
1737impl<'a> Encode for RequestServerConfigLazy<'a> {
1738 fn scratch_len(&self) -> usize {
1739 0
1740 }
1741
1742 fn encode(&self, _: &mut EncodeCursor) {}
1743}
1744
1745impl<'a> Decode<'a> for RequestServerConfigLazy<'a> {
1746 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
1747 let offset = cursor.offset();
1748 cursor.advance(Self::BASE_LEN);
1749 Ok(RequestServerConfigLazy {
1750 buffer: cursor.buffer(),
1751 offset,
1752 })
1753 }
1754}
1755
1756impl<'a> TryFrom<RequestServerConfigLazy<'a>> for RequestServerConfig {
1757 type Error = DecodeError;
1758
1759 fn try_from(other: RequestServerConfigLazy<'a>) -> Result<Self, Self::Error> {
1760 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
1761 Decode::decode(&cursor)
1762 }
1763}
1764
1765impl<'a> Copy for RequestServerConfigLazy<'a> { }
1766
1767impl<'a> Clone for RequestServerConfigLazy<'a> {
1768 fn clone(&self) -> Self {
1769 Self {
1770 buffer: self.buffer,
1771 offset: self.offset,
1772 }
1773 }
1774}
1775
1776impl<'a> core::fmt::Debug for RequestServerConfigLazy<'a> {
1777 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1778 f.debug_struct("RequestServerConfigLazy")
1779 .finish()
1780 }
1781}
1782
1783impl<'a> PartialEq for RequestServerConfigLazy<'a> {
1784 fn eq(&self, _: &Self) -> bool {
1785 true
1786 }
1787}
1788
1789#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
1790pub struct StreamInitState {}
1791
1792pub struct StreamInitStateLazy<'a> {
1793 buffer: &'a [u8],
1794 offset: usize,
1795}
1796
1797pub struct StreamInitStateGen<> {}
1798
1799impl<> Compatible<StreamInitState> for StreamInitStateGen<> { }
1800impl<> Compatible<StreamInitStateGen<>> for StreamInitState { }
1801
1802impl<> BaseLen for StreamInitStateGen<> {
1803 const BASE_LEN: usize = 0;
1804}
1805
1806impl<> Encode for StreamInitStateGen<> {
1807 fn scratch_len(&self) -> usize {
1808 0
1809 }
1810
1811 fn encode(&self, _: &mut EncodeCursor) {}
1812}
1813
1814impl Owned for StreamInitState {
1815 type Lazy<'a> = StreamInitStateLazy<'a>;
1816
1817 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
1818 TryFrom::try_from(lazy)
1819 }
1820}
1821
1822impl<'a> Lazy<'a> for StreamInitStateLazy<'a> {
1823 type Owned = StreamInitState;
1824}
1825
1826impl<'a> Compatible<StreamInitStateLazy<'a>> for StreamInitStateLazy<'a> { }
1827impl<'a> Compatible<StreamInitStateLazy<'a>> for StreamInitState { }
1828impl Compatible<StreamInitState> for StreamInitState { }
1829impl<'a> Compatible<StreamInitState> for StreamInitStateLazy<'a> { }
1830
1831impl<'a> StreamInitStateLazy<'a> {}
1832
1833impl BaseLen for StreamInitState {
1834 const BASE_LEN: usize = 0;
1835}
1836
1837impl Encode for StreamInitState {
1838 fn scratch_len(&self) -> usize {
1839 0
1840 }
1841
1842 fn encode(&self, _: &mut EncodeCursor) {}
1843}
1844
1845impl<'a> Decode<'a> for StreamInitState {
1846 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
1847
1848 Ok(StreamInitState {})
1849 }
1850}
1851
1852impl<'a> BaseLen for StreamInitStateLazy<'a> {
1853 const BASE_LEN: usize = 0;
1854}
1855
1856impl<'a> Encode for StreamInitStateLazy<'a> {
1857 fn scratch_len(&self) -> usize {
1858 0
1859 }
1860
1861 fn encode(&self, _: &mut EncodeCursor) {}
1862}
1863
1864impl<'a> Decode<'a> for StreamInitStateLazy<'a> {
1865 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
1866 let offset = cursor.offset();
1867 cursor.advance(Self::BASE_LEN);
1868 Ok(StreamInitStateLazy {
1869 buffer: cursor.buffer(),
1870 offset,
1871 })
1872 }
1873}
1874
1875impl<'a> TryFrom<StreamInitStateLazy<'a>> for StreamInitState {
1876 type Error = DecodeError;
1877
1878 fn try_from(other: StreamInitStateLazy<'a>) -> Result<Self, Self::Error> {
1879 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
1880 Decode::decode(&cursor)
1881 }
1882}
1883
1884impl<'a> Copy for StreamInitStateLazy<'a> { }
1885
1886impl<'a> Clone for StreamInitStateLazy<'a> {
1887 fn clone(&self) -> Self {
1888 Self {
1889 buffer: self.buffer,
1890 offset: self.offset,
1891 }
1892 }
1893}
1894
1895impl<'a> core::fmt::Debug for StreamInitStateLazy<'a> {
1896 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1897 f.debug_struct("StreamInitStateLazy")
1898 .finish()
1899 }
1900}
1901
1902impl<'a> PartialEq for StreamInitStateLazy<'a> {
1903 fn eq(&self, _: &Self) -> bool {
1904 true
1905 }
1906}
1907
1908#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
1909pub struct StreamReceiverConfig {}
1910
1911pub struct StreamReceiverConfigLazy<'a> {
1912 buffer: &'a [u8],
1913 offset: usize,
1914}
1915
1916pub struct StreamReceiverConfigGen<> {}
1917
1918impl<> Compatible<StreamReceiverConfig> for StreamReceiverConfigGen<> { }
1919impl<> Compatible<StreamReceiverConfigGen<>> for StreamReceiverConfig { }
1920
1921impl<> BaseLen for StreamReceiverConfigGen<> {
1922 const BASE_LEN: usize = 0;
1923}
1924
1925impl<> Encode for StreamReceiverConfigGen<> {
1926 fn scratch_len(&self) -> usize {
1927 0
1928 }
1929
1930 fn encode(&self, _: &mut EncodeCursor) {}
1931}
1932
1933impl Owned for StreamReceiverConfig {
1934 type Lazy<'a> = StreamReceiverConfigLazy<'a>;
1935
1936 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
1937 TryFrom::try_from(lazy)
1938 }
1939}
1940
1941impl<'a> Lazy<'a> for StreamReceiverConfigLazy<'a> {
1942 type Owned = StreamReceiverConfig;
1943}
1944
1945impl<'a> Compatible<StreamReceiverConfigLazy<'a>> for StreamReceiverConfigLazy<'a> { }
1946impl<'a> Compatible<StreamReceiverConfigLazy<'a>> for StreamReceiverConfig { }
1947impl Compatible<StreamReceiverConfig> for StreamReceiverConfig { }
1948impl<'a> Compatible<StreamReceiverConfig> for StreamReceiverConfigLazy<'a> { }
1949
1950impl<'a> StreamReceiverConfigLazy<'a> {}
1951
1952impl BaseLen for StreamReceiverConfig {
1953 const BASE_LEN: usize = 0;
1954}
1955
1956impl Encode for StreamReceiverConfig {
1957 fn scratch_len(&self) -> usize {
1958 0
1959 }
1960
1961 fn encode(&self, _: &mut EncodeCursor) {}
1962}
1963
1964impl<'a> Decode<'a> for StreamReceiverConfig {
1965 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
1966
1967 Ok(StreamReceiverConfig {})
1968 }
1969}
1970
1971impl<'a> BaseLen for StreamReceiverConfigLazy<'a> {
1972 const BASE_LEN: usize = 0;
1973}
1974
1975impl<'a> Encode for StreamReceiverConfigLazy<'a> {
1976 fn scratch_len(&self) -> usize {
1977 0
1978 }
1979
1980 fn encode(&self, _: &mut EncodeCursor) {}
1981}
1982
1983impl<'a> Decode<'a> for StreamReceiverConfigLazy<'a> {
1984 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
1985 let offset = cursor.offset();
1986 cursor.advance(Self::BASE_LEN);
1987 Ok(StreamReceiverConfigLazy {
1988 buffer: cursor.buffer(),
1989 offset,
1990 })
1991 }
1992}
1993
1994impl<'a> TryFrom<StreamReceiverConfigLazy<'a>> for StreamReceiverConfig {
1995 type Error = DecodeError;
1996
1997 fn try_from(other: StreamReceiverConfigLazy<'a>) -> Result<Self, Self::Error> {
1998 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
1999 Decode::decode(&cursor)
2000 }
2001}
2002
2003impl<'a> Copy for StreamReceiverConfigLazy<'a> { }
2004
2005impl<'a> Clone for StreamReceiverConfigLazy<'a> {
2006 fn clone(&self) -> Self {
2007 Self {
2008 buffer: self.buffer,
2009 offset: self.offset,
2010 }
2011 }
2012}
2013
2014impl<'a> core::fmt::Debug for StreamReceiverConfigLazy<'a> {
2015 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2016 f.debug_struct("StreamReceiverConfigLazy")
2017 .finish()
2018 }
2019}
2020
2021impl<'a> PartialEq for StreamReceiverConfigLazy<'a> {
2022 fn eq(&self, _: &Self) -> bool {
2023 true
2024 }
2025}
2026
2027#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
2028pub struct StreamSenderConfig {}
2029
2030pub struct StreamSenderConfigLazy<'a> {
2031 buffer: &'a [u8],
2032 offset: usize,
2033}
2034
2035pub struct StreamSenderConfigGen<> {}
2036
2037impl<> Compatible<StreamSenderConfig> for StreamSenderConfigGen<> { }
2038impl<> Compatible<StreamSenderConfigGen<>> for StreamSenderConfig { }
2039
2040impl<> BaseLen for StreamSenderConfigGen<> {
2041 const BASE_LEN: usize = 0;
2042}
2043
2044impl<> Encode for StreamSenderConfigGen<> {
2045 fn scratch_len(&self) -> usize {
2046 0
2047 }
2048
2049 fn encode(&self, _: &mut EncodeCursor) {}
2050}
2051
2052impl Owned for StreamSenderConfig {
2053 type Lazy<'a> = StreamSenderConfigLazy<'a>;
2054
2055 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
2056 TryFrom::try_from(lazy)
2057 }
2058}
2059
2060impl<'a> Lazy<'a> for StreamSenderConfigLazy<'a> {
2061 type Owned = StreamSenderConfig;
2062}
2063
2064impl<'a> Compatible<StreamSenderConfigLazy<'a>> for StreamSenderConfigLazy<'a> { }
2065impl<'a> Compatible<StreamSenderConfigLazy<'a>> for StreamSenderConfig { }
2066impl Compatible<StreamSenderConfig> for StreamSenderConfig { }
2067impl<'a> Compatible<StreamSenderConfig> for StreamSenderConfigLazy<'a> { }
2068
2069impl<'a> StreamSenderConfigLazy<'a> {}
2070
2071impl BaseLen for StreamSenderConfig {
2072 const BASE_LEN: usize = 0;
2073}
2074
2075impl Encode for StreamSenderConfig {
2076 fn scratch_len(&self) -> usize {
2077 0
2078 }
2079
2080 fn encode(&self, _: &mut EncodeCursor) {}
2081}
2082
2083impl<'a> Decode<'a> for StreamSenderConfig {
2084 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
2085
2086 Ok(StreamSenderConfig {})
2087 }
2088}
2089
2090impl<'a> BaseLen for StreamSenderConfigLazy<'a> {
2091 const BASE_LEN: usize = 0;
2092}
2093
2094impl<'a> Encode for StreamSenderConfigLazy<'a> {
2095 fn scratch_len(&self) -> usize {
2096 0
2097 }
2098
2099 fn encode(&self, _: &mut EncodeCursor) {}
2100}
2101
2102impl<'a> Decode<'a> for StreamSenderConfigLazy<'a> {
2103 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
2104 let offset = cursor.offset();
2105 cursor.advance(Self::BASE_LEN);
2106 Ok(StreamSenderConfigLazy {
2107 buffer: cursor.buffer(),
2108 offset,
2109 })
2110 }
2111}
2112
2113impl<'a> TryFrom<StreamSenderConfigLazy<'a>> for StreamSenderConfig {
2114 type Error = DecodeError;
2115
2116 fn try_from(other: StreamSenderConfigLazy<'a>) -> Result<Self, Self::Error> {
2117 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
2118 Decode::decode(&cursor)
2119 }
2120}
2121
2122impl<'a> Copy for StreamSenderConfigLazy<'a> { }
2123
2124impl<'a> Clone for StreamSenderConfigLazy<'a> {
2125 fn clone(&self) -> Self {
2126 Self {
2127 buffer: self.buffer,
2128 offset: self.offset,
2129 }
2130 }
2131}
2132
2133impl<'a> core::fmt::Debug for StreamSenderConfigLazy<'a> {
2134 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2135 f.debug_struct("StreamSenderConfigLazy")
2136 .finish()
2137 }
2138}
2139
2140impl<'a> PartialEq for StreamSenderConfigLazy<'a> {
2141 fn eq(&self, _: &Self) -> bool {
2142 true
2143 }
2144}
2145
2146#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
2147pub struct MultiStreamInitState {}
2148
2149pub struct MultiStreamInitStateLazy<'a> {
2150 buffer: &'a [u8],
2151 offset: usize,
2152}
2153
2154pub struct MultiStreamInitStateGen<> {}
2155
2156impl<> Compatible<MultiStreamInitState> for MultiStreamInitStateGen<> { }
2157impl<> Compatible<MultiStreamInitStateGen<>> for MultiStreamInitState { }
2158
2159impl<> BaseLen for MultiStreamInitStateGen<> {
2160 const BASE_LEN: usize = 0;
2161}
2162
2163impl<> Encode for MultiStreamInitStateGen<> {
2164 fn scratch_len(&self) -> usize {
2165 0
2166 }
2167
2168 fn encode(&self, _: &mut EncodeCursor) {}
2169}
2170
2171impl Owned for MultiStreamInitState {
2172 type Lazy<'a> = MultiStreamInitStateLazy<'a>;
2173
2174 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
2175 TryFrom::try_from(lazy)
2176 }
2177}
2178
2179impl<'a> Lazy<'a> for MultiStreamInitStateLazy<'a> {
2180 type Owned = MultiStreamInitState;
2181}
2182
2183impl<'a> Compatible<MultiStreamInitStateLazy<'a>> for MultiStreamInitStateLazy<'a> { }
2184impl<'a> Compatible<MultiStreamInitStateLazy<'a>> for MultiStreamInitState { }
2185impl Compatible<MultiStreamInitState> for MultiStreamInitState { }
2186impl<'a> Compatible<MultiStreamInitState> for MultiStreamInitStateLazy<'a> { }
2187
2188impl<'a> MultiStreamInitStateLazy<'a> {}
2189
2190impl BaseLen for MultiStreamInitState {
2191 const BASE_LEN: usize = 0;
2192}
2193
2194impl Encode for MultiStreamInitState {
2195 fn scratch_len(&self) -> usize {
2196 0
2197 }
2198
2199 fn encode(&self, _: &mut EncodeCursor) {}
2200}
2201
2202impl<'a> Decode<'a> for MultiStreamInitState {
2203 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
2204
2205 Ok(MultiStreamInitState {})
2206 }
2207}
2208
2209impl<'a> BaseLen for MultiStreamInitStateLazy<'a> {
2210 const BASE_LEN: usize = 0;
2211}
2212
2213impl<'a> Encode for MultiStreamInitStateLazy<'a> {
2214 fn scratch_len(&self) -> usize {
2215 0
2216 }
2217
2218 fn encode(&self, _: &mut EncodeCursor) {}
2219}
2220
2221impl<'a> Decode<'a> for MultiStreamInitStateLazy<'a> {
2222 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
2223 let offset = cursor.offset();
2224 cursor.advance(Self::BASE_LEN);
2225 Ok(MultiStreamInitStateLazy {
2226 buffer: cursor.buffer(),
2227 offset,
2228 })
2229 }
2230}
2231
2232impl<'a> TryFrom<MultiStreamInitStateLazy<'a>> for MultiStreamInitState {
2233 type Error = DecodeError;
2234
2235 fn try_from(other: MultiStreamInitStateLazy<'a>) -> Result<Self, Self::Error> {
2236 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
2237 Decode::decode(&cursor)
2238 }
2239}
2240
2241impl<'a> Copy for MultiStreamInitStateLazy<'a> { }
2242
2243impl<'a> Clone for MultiStreamInitStateLazy<'a> {
2244 fn clone(&self) -> Self {
2245 Self {
2246 buffer: self.buffer,
2247 offset: self.offset,
2248 }
2249 }
2250}
2251
2252impl<'a> core::fmt::Debug for MultiStreamInitStateLazy<'a> {
2253 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2254 f.debug_struct("MultiStreamInitStateLazy")
2255 .finish()
2256 }
2257}
2258
2259impl<'a> PartialEq for MultiStreamInitStateLazy<'a> {
2260 fn eq(&self, _: &Self) -> bool {
2261 true
2262 }
2263}
2264
2265#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
2266pub struct MultiStreamReceiverConfig {}
2267
2268pub struct MultiStreamReceiverConfigLazy<'a> {
2269 buffer: &'a [u8],
2270 offset: usize,
2271}
2272
2273pub struct MultiStreamReceiverConfigGen<> {}
2274
2275impl<> Compatible<MultiStreamReceiverConfig> for MultiStreamReceiverConfigGen<> { }
2276impl<> Compatible<MultiStreamReceiverConfigGen<>> for MultiStreamReceiverConfig { }
2277
2278impl<> BaseLen for MultiStreamReceiverConfigGen<> {
2279 const BASE_LEN: usize = 0;
2280}
2281
2282impl<> Encode for MultiStreamReceiverConfigGen<> {
2283 fn scratch_len(&self) -> usize {
2284 0
2285 }
2286
2287 fn encode(&self, _: &mut EncodeCursor) {}
2288}
2289
2290impl Owned for MultiStreamReceiverConfig {
2291 type Lazy<'a> = MultiStreamReceiverConfigLazy<'a>;
2292
2293 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
2294 TryFrom::try_from(lazy)
2295 }
2296}
2297
2298impl<'a> Lazy<'a> for MultiStreamReceiverConfigLazy<'a> {
2299 type Owned = MultiStreamReceiverConfig;
2300}
2301
2302impl<'a> Compatible<MultiStreamReceiverConfigLazy<'a>> for MultiStreamReceiverConfigLazy<'a> { }
2303impl<'a> Compatible<MultiStreamReceiverConfigLazy<'a>> for MultiStreamReceiverConfig { }
2304impl Compatible<MultiStreamReceiverConfig> for MultiStreamReceiverConfig { }
2305impl<'a> Compatible<MultiStreamReceiverConfig> for MultiStreamReceiverConfigLazy<'a> { }
2306
2307impl<'a> MultiStreamReceiverConfigLazy<'a> {}
2308
2309impl BaseLen for MultiStreamReceiverConfig {
2310 const BASE_LEN: usize = 0;
2311}
2312
2313impl Encode for MultiStreamReceiverConfig {
2314 fn scratch_len(&self) -> usize {
2315 0
2316 }
2317
2318 fn encode(&self, _: &mut EncodeCursor) {}
2319}
2320
2321impl<'a> Decode<'a> for MultiStreamReceiverConfig {
2322 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
2323
2324 Ok(MultiStreamReceiverConfig {})
2325 }
2326}
2327
2328impl<'a> BaseLen for MultiStreamReceiverConfigLazy<'a> {
2329 const BASE_LEN: usize = 0;
2330}
2331
2332impl<'a> Encode for MultiStreamReceiverConfigLazy<'a> {
2333 fn scratch_len(&self) -> usize {
2334 0
2335 }
2336
2337 fn encode(&self, _: &mut EncodeCursor) {}
2338}
2339
2340impl<'a> Decode<'a> for MultiStreamReceiverConfigLazy<'a> {
2341 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
2342 let offset = cursor.offset();
2343 cursor.advance(Self::BASE_LEN);
2344 Ok(MultiStreamReceiverConfigLazy {
2345 buffer: cursor.buffer(),
2346 offset,
2347 })
2348 }
2349}
2350
2351impl<'a> TryFrom<MultiStreamReceiverConfigLazy<'a>> for MultiStreamReceiverConfig {
2352 type Error = DecodeError;
2353
2354 fn try_from(other: MultiStreamReceiverConfigLazy<'a>) -> Result<Self, Self::Error> {
2355 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
2356 Decode::decode(&cursor)
2357 }
2358}
2359
2360impl<'a> Copy for MultiStreamReceiverConfigLazy<'a> { }
2361
2362impl<'a> Clone for MultiStreamReceiverConfigLazy<'a> {
2363 fn clone(&self) -> Self {
2364 Self {
2365 buffer: self.buffer,
2366 offset: self.offset,
2367 }
2368 }
2369}
2370
2371impl<'a> core::fmt::Debug for MultiStreamReceiverConfigLazy<'a> {
2372 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2373 f.debug_struct("MultiStreamReceiverConfigLazy")
2374 .finish()
2375 }
2376}
2377
2378impl<'a> PartialEq for MultiStreamReceiverConfigLazy<'a> {
2379 fn eq(&self, _: &Self) -> bool {
2380 true
2381 }
2382}
2383
2384#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
2385pub struct MultiStreamSenderConfig {}
2386
2387pub struct MultiStreamSenderConfigLazy<'a> {
2388 buffer: &'a [u8],
2389 offset: usize,
2390}
2391
2392pub struct MultiStreamSenderConfigGen<> {}
2393
2394impl<> Compatible<MultiStreamSenderConfig> for MultiStreamSenderConfigGen<> { }
2395impl<> Compatible<MultiStreamSenderConfigGen<>> for MultiStreamSenderConfig { }
2396
2397impl<> BaseLen for MultiStreamSenderConfigGen<> {
2398 const BASE_LEN: usize = 0;
2399}
2400
2401impl<> Encode for MultiStreamSenderConfigGen<> {
2402 fn scratch_len(&self) -> usize {
2403 0
2404 }
2405
2406 fn encode(&self, _: &mut EncodeCursor) {}
2407}
2408
2409impl Owned for MultiStreamSenderConfig {
2410 type Lazy<'a> = MultiStreamSenderConfigLazy<'a>;
2411
2412 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
2413 TryFrom::try_from(lazy)
2414 }
2415}
2416
2417impl<'a> Lazy<'a> for MultiStreamSenderConfigLazy<'a> {
2418 type Owned = MultiStreamSenderConfig;
2419}
2420
2421impl<'a> Compatible<MultiStreamSenderConfigLazy<'a>> for MultiStreamSenderConfigLazy<'a> { }
2422impl<'a> Compatible<MultiStreamSenderConfigLazy<'a>> for MultiStreamSenderConfig { }
2423impl Compatible<MultiStreamSenderConfig> for MultiStreamSenderConfig { }
2424impl<'a> Compatible<MultiStreamSenderConfig> for MultiStreamSenderConfigLazy<'a> { }
2425
2426impl<'a> MultiStreamSenderConfigLazy<'a> {}
2427
2428impl BaseLen for MultiStreamSenderConfig {
2429 const BASE_LEN: usize = 0;
2430}
2431
2432impl Encode for MultiStreamSenderConfig {
2433 fn scratch_len(&self) -> usize {
2434 0
2435 }
2436
2437 fn encode(&self, _: &mut EncodeCursor) {}
2438}
2439
2440impl<'a> Decode<'a> for MultiStreamSenderConfig {
2441 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
2442
2443 Ok(MultiStreamSenderConfig {})
2444 }
2445}
2446
2447impl<'a> BaseLen for MultiStreamSenderConfigLazy<'a> {
2448 const BASE_LEN: usize = 0;
2449}
2450
2451impl<'a> Encode for MultiStreamSenderConfigLazy<'a> {
2452 fn scratch_len(&self) -> usize {
2453 0
2454 }
2455
2456 fn encode(&self, _: &mut EncodeCursor) {}
2457}
2458
2459impl<'a> Decode<'a> for MultiStreamSenderConfigLazy<'a> {
2460 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
2461 let offset = cursor.offset();
2462 cursor.advance(Self::BASE_LEN);
2463 Ok(MultiStreamSenderConfigLazy {
2464 buffer: cursor.buffer(),
2465 offset,
2466 })
2467 }
2468}
2469
2470impl<'a> TryFrom<MultiStreamSenderConfigLazy<'a>> for MultiStreamSenderConfig {
2471 type Error = DecodeError;
2472
2473 fn try_from(other: MultiStreamSenderConfigLazy<'a>) -> Result<Self, Self::Error> {
2474 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
2475 Decode::decode(&cursor)
2476 }
2477}
2478
2479impl<'a> Copy for MultiStreamSenderConfigLazy<'a> { }
2480
2481impl<'a> Clone for MultiStreamSenderConfigLazy<'a> {
2482 fn clone(&self) -> Self {
2483 Self {
2484 buffer: self.buffer,
2485 offset: self.offset,
2486 }
2487 }
2488}
2489
2490impl<'a> core::fmt::Debug for MultiStreamSenderConfigLazy<'a> {
2491 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2492 f.debug_struct("MultiStreamSenderConfigLazy")
2493 .finish()
2494 }
2495}
2496
2497impl<'a> PartialEq for MultiStreamSenderConfigLazy<'a> {
2498 fn eq(&self, _: &Self) -> bool {
2499 true
2500 }
2501}
2502
2503#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
2504pub struct ByteStreamInitState {}
2505
2506pub struct ByteStreamInitStateLazy<'a> {
2507 buffer: &'a [u8],
2508 offset: usize,
2509}
2510
2511pub struct ByteStreamInitStateGen<> {}
2512
2513impl<> Compatible<ByteStreamInitState> for ByteStreamInitStateGen<> { }
2514impl<> Compatible<ByteStreamInitStateGen<>> for ByteStreamInitState { }
2515
2516impl<> BaseLen for ByteStreamInitStateGen<> {
2517 const BASE_LEN: usize = 0;
2518}
2519
2520impl<> Encode for ByteStreamInitStateGen<> {
2521 fn scratch_len(&self) -> usize {
2522 0
2523 }
2524
2525 fn encode(&self, _: &mut EncodeCursor) {}
2526}
2527
2528impl Owned for ByteStreamInitState {
2529 type Lazy<'a> = ByteStreamInitStateLazy<'a>;
2530
2531 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
2532 TryFrom::try_from(lazy)
2533 }
2534}
2535
2536impl<'a> Lazy<'a> for ByteStreamInitStateLazy<'a> {
2537 type Owned = ByteStreamInitState;
2538}
2539
2540impl<'a> Compatible<ByteStreamInitStateLazy<'a>> for ByteStreamInitStateLazy<'a> { }
2541impl<'a> Compatible<ByteStreamInitStateLazy<'a>> for ByteStreamInitState { }
2542impl Compatible<ByteStreamInitState> for ByteStreamInitState { }
2543impl<'a> Compatible<ByteStreamInitState> for ByteStreamInitStateLazy<'a> { }
2544
2545impl<'a> ByteStreamInitStateLazy<'a> {}
2546
2547impl BaseLen for ByteStreamInitState {
2548 const BASE_LEN: usize = 0;
2549}
2550
2551impl Encode for ByteStreamInitState {
2552 fn scratch_len(&self) -> usize {
2553 0
2554 }
2555
2556 fn encode(&self, _: &mut EncodeCursor) {}
2557}
2558
2559impl<'a> Decode<'a> for ByteStreamInitState {
2560 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
2561
2562 Ok(ByteStreamInitState {})
2563 }
2564}
2565
2566impl<'a> BaseLen for ByteStreamInitStateLazy<'a> {
2567 const BASE_LEN: usize = 0;
2568}
2569
2570impl<'a> Encode for ByteStreamInitStateLazy<'a> {
2571 fn scratch_len(&self) -> usize {
2572 0
2573 }
2574
2575 fn encode(&self, _: &mut EncodeCursor) {}
2576}
2577
2578impl<'a> Decode<'a> for ByteStreamInitStateLazy<'a> {
2579 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
2580 let offset = cursor.offset();
2581 cursor.advance(Self::BASE_LEN);
2582 Ok(ByteStreamInitStateLazy {
2583 buffer: cursor.buffer(),
2584 offset,
2585 })
2586 }
2587}
2588
2589impl<'a> TryFrom<ByteStreamInitStateLazy<'a>> for ByteStreamInitState {
2590 type Error = DecodeError;
2591
2592 fn try_from(other: ByteStreamInitStateLazy<'a>) -> Result<Self, Self::Error> {
2593 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
2594 Decode::decode(&cursor)
2595 }
2596}
2597
2598impl<'a> Copy for ByteStreamInitStateLazy<'a> { }
2599
2600impl<'a> Clone for ByteStreamInitStateLazy<'a> {
2601 fn clone(&self) -> Self {
2602 Self {
2603 buffer: self.buffer,
2604 offset: self.offset,
2605 }
2606 }
2607}
2608
2609impl<'a> core::fmt::Debug for ByteStreamInitStateLazy<'a> {
2610 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2611 f.debug_struct("ByteStreamInitStateLazy")
2612 .finish()
2613 }
2614}
2615
2616impl<'a> PartialEq for ByteStreamInitStateLazy<'a> {
2617 fn eq(&self, _: &Self) -> bool {
2618 true
2619 }
2620}
2621
2622#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
2623pub struct ByteStreamReceiverConfig {}
2624
2625pub struct ByteStreamReceiverConfigLazy<'a> {
2626 buffer: &'a [u8],
2627 offset: usize,
2628}
2629
2630pub struct ByteStreamReceiverConfigGen<> {}
2631
2632impl<> Compatible<ByteStreamReceiverConfig> for ByteStreamReceiverConfigGen<> { }
2633impl<> Compatible<ByteStreamReceiverConfigGen<>> for ByteStreamReceiverConfig { }
2634
2635impl<> BaseLen for ByteStreamReceiverConfigGen<> {
2636 const BASE_LEN: usize = 0;
2637}
2638
2639impl<> Encode for ByteStreamReceiverConfigGen<> {
2640 fn scratch_len(&self) -> usize {
2641 0
2642 }
2643
2644 fn encode(&self, _: &mut EncodeCursor) {}
2645}
2646
2647impl Owned for ByteStreamReceiverConfig {
2648 type Lazy<'a> = ByteStreamReceiverConfigLazy<'a>;
2649
2650 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
2651 TryFrom::try_from(lazy)
2652 }
2653}
2654
2655impl<'a> Lazy<'a> for ByteStreamReceiverConfigLazy<'a> {
2656 type Owned = ByteStreamReceiverConfig;
2657}
2658
2659impl<'a> Compatible<ByteStreamReceiverConfigLazy<'a>> for ByteStreamReceiverConfigLazy<'a> { }
2660impl<'a> Compatible<ByteStreamReceiverConfigLazy<'a>> for ByteStreamReceiverConfig { }
2661impl Compatible<ByteStreamReceiverConfig> for ByteStreamReceiverConfig { }
2662impl<'a> Compatible<ByteStreamReceiverConfig> for ByteStreamReceiverConfigLazy<'a> { }
2663
2664impl<'a> ByteStreamReceiverConfigLazy<'a> {}
2665
2666impl BaseLen for ByteStreamReceiverConfig {
2667 const BASE_LEN: usize = 0;
2668}
2669
2670impl Encode for ByteStreamReceiverConfig {
2671 fn scratch_len(&self) -> usize {
2672 0
2673 }
2674
2675 fn encode(&self, _: &mut EncodeCursor) {}
2676}
2677
2678impl<'a> Decode<'a> for ByteStreamReceiverConfig {
2679 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
2680
2681 Ok(ByteStreamReceiverConfig {})
2682 }
2683}
2684
2685impl<'a> BaseLen for ByteStreamReceiverConfigLazy<'a> {
2686 const BASE_LEN: usize = 0;
2687}
2688
2689impl<'a> Encode for ByteStreamReceiverConfigLazy<'a> {
2690 fn scratch_len(&self) -> usize {
2691 0
2692 }
2693
2694 fn encode(&self, _: &mut EncodeCursor) {}
2695}
2696
2697impl<'a> Decode<'a> for ByteStreamReceiverConfigLazy<'a> {
2698 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
2699 let offset = cursor.offset();
2700 cursor.advance(Self::BASE_LEN);
2701 Ok(ByteStreamReceiverConfigLazy {
2702 buffer: cursor.buffer(),
2703 offset,
2704 })
2705 }
2706}
2707
2708impl<'a> TryFrom<ByteStreamReceiverConfigLazy<'a>> for ByteStreamReceiverConfig {
2709 type Error = DecodeError;
2710
2711 fn try_from(other: ByteStreamReceiverConfigLazy<'a>) -> Result<Self, Self::Error> {
2712 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
2713 Decode::decode(&cursor)
2714 }
2715}
2716
2717impl<'a> Copy for ByteStreamReceiverConfigLazy<'a> { }
2718
2719impl<'a> Clone for ByteStreamReceiverConfigLazy<'a> {
2720 fn clone(&self) -> Self {
2721 Self {
2722 buffer: self.buffer,
2723 offset: self.offset,
2724 }
2725 }
2726}
2727
2728impl<'a> core::fmt::Debug for ByteStreamReceiverConfigLazy<'a> {
2729 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2730 f.debug_struct("ByteStreamReceiverConfigLazy")
2731 .finish()
2732 }
2733}
2734
2735impl<'a> PartialEq for ByteStreamReceiverConfigLazy<'a> {
2736 fn eq(&self, _: &Self) -> bool {
2737 true
2738 }
2739}
2740
2741#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Default)]
2742pub struct ByteStreamSenderConfig {}
2743
2744pub struct ByteStreamSenderConfigLazy<'a> {
2745 buffer: &'a [u8],
2746 offset: usize,
2747}
2748
2749pub struct ByteStreamSenderConfigGen<> {}
2750
2751impl<> Compatible<ByteStreamSenderConfig> for ByteStreamSenderConfigGen<> { }
2752impl<> Compatible<ByteStreamSenderConfigGen<>> for ByteStreamSenderConfig { }
2753
2754impl<> BaseLen for ByteStreamSenderConfigGen<> {
2755 const BASE_LEN: usize = 0;
2756}
2757
2758impl<> Encode for ByteStreamSenderConfigGen<> {
2759 fn scratch_len(&self) -> usize {
2760 0
2761 }
2762
2763 fn encode(&self, _: &mut EncodeCursor) {}
2764}
2765
2766impl Owned for ByteStreamSenderConfig {
2767 type Lazy<'a> = ByteStreamSenderConfigLazy<'a>;
2768
2769 fn lazy_to_owned(lazy: Self::Lazy<'_>) -> DecodeResult<Self> {
2770 TryFrom::try_from(lazy)
2771 }
2772}
2773
2774impl<'a> Lazy<'a> for ByteStreamSenderConfigLazy<'a> {
2775 type Owned = ByteStreamSenderConfig;
2776}
2777
2778impl<'a> Compatible<ByteStreamSenderConfigLazy<'a>> for ByteStreamSenderConfigLazy<'a> { }
2779impl<'a> Compatible<ByteStreamSenderConfigLazy<'a>> for ByteStreamSenderConfig { }
2780impl Compatible<ByteStreamSenderConfig> for ByteStreamSenderConfig { }
2781impl<'a> Compatible<ByteStreamSenderConfig> for ByteStreamSenderConfigLazy<'a> { }
2782
2783impl<'a> ByteStreamSenderConfigLazy<'a> {}
2784
2785impl BaseLen for ByteStreamSenderConfig {
2786 const BASE_LEN: usize = 0;
2787}
2788
2789impl Encode for ByteStreamSenderConfig {
2790 fn scratch_len(&self) -> usize {
2791 0
2792 }
2793
2794 fn encode(&self, _: &mut EncodeCursor) {}
2795}
2796
2797impl<'a> Decode<'a> for ByteStreamSenderConfig {
2798 fn decode(_: &DecodeCursor<'a>) -> DecodeResult<Self> {
2799
2800 Ok(ByteStreamSenderConfig {})
2801 }
2802}
2803
2804impl<'a> BaseLen for ByteStreamSenderConfigLazy<'a> {
2805 const BASE_LEN: usize = 0;
2806}
2807
2808impl<'a> Encode for ByteStreamSenderConfigLazy<'a> {
2809 fn scratch_len(&self) -> usize {
2810 0
2811 }
2812
2813 fn encode(&self, _: &mut EncodeCursor) {}
2814}
2815
2816impl<'a> Decode<'a> for ByteStreamSenderConfigLazy<'a> {
2817 fn decode(cursor: &DecodeCursor<'a>) -> DecodeResult<Self> {
2818 let offset = cursor.offset();
2819 cursor.advance(Self::BASE_LEN);
2820 Ok(ByteStreamSenderConfigLazy {
2821 buffer: cursor.buffer(),
2822 offset,
2823 })
2824 }
2825}
2826
2827impl<'a> TryFrom<ByteStreamSenderConfigLazy<'a>> for ByteStreamSenderConfig {
2828 type Error = DecodeError;
2829
2830 fn try_from(other: ByteStreamSenderConfigLazy<'a>) -> Result<Self, Self::Error> {
2831 let cursor = DecodeCursor::at_offset(other.buffer, other.offset);
2832 Decode::decode(&cursor)
2833 }
2834}
2835
2836impl<'a> Copy for ByteStreamSenderConfigLazy<'a> { }
2837
2838impl<'a> Clone for ByteStreamSenderConfigLazy<'a> {
2839 fn clone(&self) -> Self {
2840 Self {
2841 buffer: self.buffer,
2842 offset: self.offset,
2843 }
2844 }
2845}
2846
2847impl<'a> core::fmt::Debug for ByteStreamSenderConfigLazy<'a> {
2848 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2849 f.debug_struct("ByteStreamSenderConfigLazy")
2850 .finish()
2851 }
2852}
2853
2854impl<'a> PartialEq for ByteStreamSenderConfigLazy<'a> {
2855 fn eq(&self, _: &Self) -> bool {
2856 true
2857 }
2858}