File size: 31,074 Bytes
3374e90 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 | // automatically generated by the FlatBuffers compiler, do not modify
// @generated
extern crate alloc;
#[allow(unused_imports, dead_code)]
pub mod bex {
#[allow(unused_imports, dead_code)]
pub mod wire {
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_MEDIA_KIND: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_MEDIA_KIND: i8 = 10;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
#[allow(non_camel_case_types)]
pub const ENUM_VALUES_MEDIA_KIND: [MediaKind; 11] = [
MediaKind::Movie,
MediaKind::Series,
MediaKind::Anime,
MediaKind::Short,
MediaKind::Special,
MediaKind::Documentary,
MediaKind::Music,
MediaKind::Podcast,
MediaKind::Book,
MediaKind::Live,
MediaKind::Unknown,
];
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct MediaKind(pub i8);
#[allow(non_upper_case_globals)]
impl MediaKind {
pub const Movie: Self = Self(0);
pub const Series: Self = Self(1);
pub const Anime: Self = Self(2);
pub const Short: Self = Self(3);
pub const Special: Self = Self(4);
pub const Documentary: Self = Self(5);
pub const Music: Self = Self(6);
pub const Podcast: Self = Self(7);
pub const Book: Self = Self(8);
pub const Live: Self = Self(9);
pub const Unknown: Self = Self(10);
pub const ENUM_MIN: i8 = 0;
pub const ENUM_MAX: i8 = 10;
pub const ENUM_VALUES: &'static [Self] = &[
Self::Movie,
Self::Series,
Self::Anime,
Self::Short,
Self::Special,
Self::Documentary,
Self::Music,
Self::Podcast,
Self::Book,
Self::Live,
Self::Unknown,
];
/// Returns the variant's name or "" if unknown.
pub fn variant_name(self) -> Option<&'static str> {
match self {
Self::Movie => Some("Movie"),
Self::Series => Some("Series"),
Self::Anime => Some("Anime"),
Self::Short => Some("Short"),
Self::Special => Some("Special"),
Self::Documentary => Some("Documentary"),
Self::Music => Some("Music"),
Self::Podcast => Some("Podcast"),
Self::Book => Some("Book"),
Self::Live => Some("Live"),
Self::Unknown => Some("Unknown"),
_ => None,
}
}
}
impl ::core::fmt::Debug for MediaKind {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
if let Some(name) = self.variant_name() {
f.write_str(name)
} else {
f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
}
}
}
impl<'a> ::flatbuffers::Follow<'a> for MediaKind {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = unsafe { ::flatbuffers::read_scalar_at::<i8>(buf, loc) };
Self(b)
}
}
impl ::flatbuffers::Push for MediaKind {
type Output = MediaKind;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
unsafe { ::flatbuffers::emplace_scalar::<i8>(dst, self.0) };
}
}
impl ::flatbuffers::EndianScalar for MediaKind {
type Scalar = i8;
#[inline]
fn to_little_endian(self) -> i8 {
self.0.to_le()
}
#[inline]
#[allow(clippy::wrong_self_convention)]
fn from_little_endian(v: i8) -> Self {
let b = i8::from_le(v);
Self(b)
}
}
impl<'a> ::flatbuffers::Verifiable for MediaKind {
#[inline]
fn run_verifier(
v: &mut ::flatbuffers::Verifier, pos: usize
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
i8::run_verifier(v, pos)
}
}
impl ::flatbuffers::SimpleToVerifyInSlice for MediaKind {}
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_STATUS: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_STATUS: i8 = 5;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
#[allow(non_camel_case_types)]
pub const ENUM_VALUES_STATUS: [Status; 6] = [
Status::Unknown,
Status::Upcoming,
Status::Ongoing,
Status::Completed,
Status::Cancelled,
Status::Paused,
];
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct Status(pub i8);
#[allow(non_upper_case_globals)]
impl Status {
pub const Unknown: Self = Self(0);
pub const Upcoming: Self = Self(1);
pub const Ongoing: Self = Self(2);
pub const Completed: Self = Self(3);
pub const Cancelled: Self = Self(4);
pub const Paused: Self = Self(5);
pub const ENUM_MIN: i8 = 0;
pub const ENUM_MAX: i8 = 5;
pub const ENUM_VALUES: &'static [Self] = &[
Self::Unknown,
Self::Upcoming,
Self::Ongoing,
Self::Completed,
Self::Cancelled,
Self::Paused,
];
/// Returns the variant's name or "" if unknown.
pub fn variant_name(self) -> Option<&'static str> {
match self {
Self::Unknown => Some("Unknown"),
Self::Upcoming => Some("Upcoming"),
Self::Ongoing => Some("Ongoing"),
Self::Completed => Some("Completed"),
Self::Cancelled => Some("Cancelled"),
Self::Paused => Some("Paused"),
_ => None,
}
}
}
impl ::core::fmt::Debug for Status {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
if let Some(name) = self.variant_name() {
f.write_str(name)
} else {
f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
}
}
}
impl<'a> ::flatbuffers::Follow<'a> for Status {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = unsafe { ::flatbuffers::read_scalar_at::<i8>(buf, loc) };
Self(b)
}
}
impl ::flatbuffers::Push for Status {
type Output = Status;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
unsafe { ::flatbuffers::emplace_scalar::<i8>(dst, self.0) };
}
}
impl ::flatbuffers::EndianScalar for Status {
type Scalar = i8;
#[inline]
fn to_little_endian(self) -> i8 {
self.0.to_le()
}
#[inline]
#[allow(clippy::wrong_self_convention)]
fn from_little_endian(v: i8) -> Self {
let b = i8::from_le(v);
Self(b)
}
}
impl<'a> ::flatbuffers::Verifiable for Status {
#[inline]
fn run_verifier(
v: &mut ::flatbuffers::Verifier, pos: usize
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
i8::run_verifier(v, pos)
}
}
impl ::flatbuffers::SimpleToVerifyInSlice for Status {}
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_STREAM_FORMAT: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_STREAM_FORMAT: i8 = 3;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
#[allow(non_camel_case_types)]
pub const ENUM_VALUES_STREAM_FORMAT: [StreamFormat; 4] = [
StreamFormat::Hls,
StreamFormat::Dash,
StreamFormat::Progressive,
StreamFormat::Unknown,
];
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct StreamFormat(pub i8);
#[allow(non_upper_case_globals)]
impl StreamFormat {
pub const Hls: Self = Self(0);
pub const Dash: Self = Self(1);
pub const Progressive: Self = Self(2);
pub const Unknown: Self = Self(3);
pub const ENUM_MIN: i8 = 0;
pub const ENUM_MAX: i8 = 3;
pub const ENUM_VALUES: &'static [Self] = &[
Self::Hls,
Self::Dash,
Self::Progressive,
Self::Unknown,
];
/// Returns the variant's name or "" if unknown.
pub fn variant_name(self) -> Option<&'static str> {
match self {
Self::Hls => Some("Hls"),
Self::Dash => Some("Dash"),
Self::Progressive => Some("Progressive"),
Self::Unknown => Some("Unknown"),
_ => None,
}
}
}
impl ::core::fmt::Debug for StreamFormat {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
if let Some(name) = self.variant_name() {
f.write_str(name)
} else {
f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
}
}
}
impl<'a> ::flatbuffers::Follow<'a> for StreamFormat {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = unsafe { ::flatbuffers::read_scalar_at::<i8>(buf, loc) };
Self(b)
}
}
impl ::flatbuffers::Push for StreamFormat {
type Output = StreamFormat;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
unsafe { ::flatbuffers::emplace_scalar::<i8>(dst, self.0) };
}
}
impl ::flatbuffers::EndianScalar for StreamFormat {
type Scalar = i8;
#[inline]
fn to_little_endian(self) -> i8 {
self.0.to_le()
}
#[inline]
#[allow(clippy::wrong_self_convention)]
fn from_little_endian(v: i8) -> Self {
let b = i8::from_le(v);
Self(b)
}
}
impl<'a> ::flatbuffers::Verifiable for StreamFormat {
#[inline]
fn run_verifier(
v: &mut ::flatbuffers::Verifier, pos: usize
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
i8::run_verifier(v, pos)
}
}
impl ::flatbuffers::SimpleToVerifyInSlice for StreamFormat {}
pub enum ImageOffset {}
#[derive(Copy, Clone, PartialEq)]
pub struct Image<'a> {
pub _tab: ::flatbuffers::Table<'a>,
}
impl<'a> ::flatbuffers::Follow<'a> for Image<'a> {
type Inner = Image<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
}
}
impl<'a> Image<'a> {
pub const VT_URL: ::flatbuffers::VOffsetT = 4;
pub const VT_LAYOUT: ::flatbuffers::VOffsetT = 6;
pub const VT_WIDTH: ::flatbuffers::VOffsetT = 8;
pub const VT_HEIGHT: ::flatbuffers::VOffsetT = 10;
pub const VT_BLURHASH: ::flatbuffers::VOffsetT = 12;
#[inline]
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
Image { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
args: &'args ImageArgs<'args>
) -> ::flatbuffers::WIPOffset<Image<'bldr>> {
let mut builder = ImageBuilder::new(_fbb);
if let Some(x) = args.blurhash { builder.add_blurhash(x); }
builder.add_height(args.height);
builder.add_width(args.width);
if let Some(x) = args.layout { builder.add_layout(x); }
if let Some(x) = args.url { builder.add_url(x); }
builder.finish()
}
#[inline]
pub fn url(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Image::VT_URL, None)}
}
#[inline]
pub fn layout(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Image::VT_LAYOUT, None)}
}
#[inline]
pub fn width(&self) -> u32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<u32>(Image::VT_WIDTH, Some(0)).unwrap()}
}
#[inline]
pub fn height(&self) -> u32 {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<u32>(Image::VT_HEIGHT, Some(0)).unwrap()}
}
#[inline]
pub fn blurhash(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Image::VT_BLURHASH, None)}
}
}
impl ::flatbuffers::Verifiable for Image<'_> {
#[inline]
fn run_verifier(
v: &mut ::flatbuffers::Verifier, pos: usize
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
v.visit_table(pos)?
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("url", Self::VT_URL, false)?
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("layout", Self::VT_LAYOUT, false)?
.visit_field::<u32>("width", Self::VT_WIDTH, false)?
.visit_field::<u32>("height", Self::VT_HEIGHT, false)?
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("blurhash", Self::VT_BLURHASH, false)?
.finish();
Ok(())
}
}
pub struct ImageArgs<'a> {
pub url: Option<::flatbuffers::WIPOffset<&'a str>>,
pub layout: Option<::flatbuffers::WIPOffset<&'a str>>,
pub width: u32,
pub height: u32,
pub blurhash: Option<::flatbuffers::WIPOffset<&'a str>>,
}
impl<'a> Default for ImageArgs<'a> {
#[inline]
fn default() -> Self {
ImageArgs {
url: None,
layout: None,
width: 0,
height: 0,
blurhash: None,
}
}
}
pub struct ImageBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ImageBuilder<'a, 'b, A> {
#[inline]
pub fn add_url(&mut self, url: ::flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Image::VT_URL, url);
}
#[inline]
pub fn add_layout(&mut self, layout: ::flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Image::VT_LAYOUT, layout);
}
#[inline]
pub fn add_width(&mut self, width: u32) {
self.fbb_.push_slot::<u32>(Image::VT_WIDTH, width, 0);
}
#[inline]
pub fn add_height(&mut self, height: u32) {
self.fbb_.push_slot::<u32>(Image::VT_HEIGHT, height, 0);
}
#[inline]
pub fn add_blurhash(&mut self, blurhash: ::flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Image::VT_BLURHASH, blurhash);
}
#[inline]
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ImageBuilder<'a, 'b, A> {
let start = _fbb.start_table();
ImageBuilder {
fbb_: _fbb,
start_: start,
}
}
#[inline]
pub fn finish(self) -> ::flatbuffers::WIPOffset<Image<'a>> {
let o = self.fbb_.end_table(self.start_);
::flatbuffers::WIPOffset::new(o.value())
}
}
impl ::core::fmt::Debug for Image<'_> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
let mut ds = f.debug_struct("Image");
ds.field("url", &self.url());
ds.field("layout", &self.layout());
ds.field("width", &self.width());
ds.field("height", &self.height());
ds.field("blurhash", &self.blurhash());
ds.finish()
}
}
pub enum ImageSetOffset {}
#[derive(Copy, Clone, PartialEq)]
pub struct ImageSet<'a> {
pub _tab: ::flatbuffers::Table<'a>,
}
impl<'a> ::flatbuffers::Follow<'a> for ImageSet<'a> {
type Inner = ImageSet<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
}
}
impl<'a> ImageSet<'a> {
pub const VT_LOW: ::flatbuffers::VOffsetT = 4;
pub const VT_MEDIUM: ::flatbuffers::VOffsetT = 6;
pub const VT_HIGH: ::flatbuffers::VOffsetT = 8;
pub const VT_BACKDROP: ::flatbuffers::VOffsetT = 10;
pub const VT_LOGO: ::flatbuffers::VOffsetT = 12;
#[inline]
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
ImageSet { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
args: &'args ImageSetArgs<'args>
) -> ::flatbuffers::WIPOffset<ImageSet<'bldr>> {
let mut builder = ImageSetBuilder::new(_fbb);
if let Some(x) = args.logo { builder.add_logo(x); }
if let Some(x) = args.backdrop { builder.add_backdrop(x); }
if let Some(x) = args.high { builder.add_high(x); }
if let Some(x) = args.medium { builder.add_medium(x); }
if let Some(x) = args.low { builder.add_low(x); }
builder.finish()
}
#[inline]
pub fn low(&self) -> Option<Image<'a>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<Image>>(ImageSet::VT_LOW, None)}
}
#[inline]
pub fn medium(&self) -> Option<Image<'a>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<Image>>(ImageSet::VT_MEDIUM, None)}
}
#[inline]
pub fn high(&self) -> Option<Image<'a>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<Image>>(ImageSet::VT_HIGH, None)}
}
#[inline]
pub fn backdrop(&self) -> Option<Image<'a>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<Image>>(ImageSet::VT_BACKDROP, None)}
}
#[inline]
pub fn logo(&self) -> Option<Image<'a>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<Image>>(ImageSet::VT_LOGO, None)}
}
}
impl ::flatbuffers::Verifiable for ImageSet<'_> {
#[inline]
fn run_verifier(
v: &mut ::flatbuffers::Verifier, pos: usize
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
v.visit_table(pos)?
.visit_field::<::flatbuffers::ForwardsUOffset<Image>>("low", Self::VT_LOW, false)?
.visit_field::<::flatbuffers::ForwardsUOffset<Image>>("medium", Self::VT_MEDIUM, false)?
.visit_field::<::flatbuffers::ForwardsUOffset<Image>>("high", Self::VT_HIGH, false)?
.visit_field::<::flatbuffers::ForwardsUOffset<Image>>("backdrop", Self::VT_BACKDROP, false)?
.visit_field::<::flatbuffers::ForwardsUOffset<Image>>("logo", Self::VT_LOGO, false)?
.finish();
Ok(())
}
}
pub struct ImageSetArgs<'a> {
pub low: Option<::flatbuffers::WIPOffset<Image<'a>>>,
pub medium: Option<::flatbuffers::WIPOffset<Image<'a>>>,
pub high: Option<::flatbuffers::WIPOffset<Image<'a>>>,
pub backdrop: Option<::flatbuffers::WIPOffset<Image<'a>>>,
pub logo: Option<::flatbuffers::WIPOffset<Image<'a>>>,
}
impl<'a> Default for ImageSetArgs<'a> {
#[inline]
fn default() -> Self {
ImageSetArgs {
low: None,
medium: None,
high: None,
backdrop: None,
logo: None,
}
}
}
pub struct ImageSetBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ImageSetBuilder<'a, 'b, A> {
#[inline]
pub fn add_low(&mut self, low: ::flatbuffers::WIPOffset<Image<'b >>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<Image>>(ImageSet::VT_LOW, low);
}
#[inline]
pub fn add_medium(&mut self, medium: ::flatbuffers::WIPOffset<Image<'b >>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<Image>>(ImageSet::VT_MEDIUM, medium);
}
#[inline]
pub fn add_high(&mut self, high: ::flatbuffers::WIPOffset<Image<'b >>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<Image>>(ImageSet::VT_HIGH, high);
}
#[inline]
pub fn add_backdrop(&mut self, backdrop: ::flatbuffers::WIPOffset<Image<'b >>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<Image>>(ImageSet::VT_BACKDROP, backdrop);
}
#[inline]
pub fn add_logo(&mut self, logo: ::flatbuffers::WIPOffset<Image<'b >>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<Image>>(ImageSet::VT_LOGO, logo);
}
#[inline]
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ImageSetBuilder<'a, 'b, A> {
let start = _fbb.start_table();
ImageSetBuilder {
fbb_: _fbb,
start_: start,
}
}
#[inline]
pub fn finish(self) -> ::flatbuffers::WIPOffset<ImageSet<'a>> {
let o = self.fbb_.end_table(self.start_);
::flatbuffers::WIPOffset::new(o.value())
}
}
impl ::core::fmt::Debug for ImageSet<'_> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
let mut ds = f.debug_struct("ImageSet");
ds.field("low", &self.low());
ds.field("medium", &self.medium());
ds.field("high", &self.high());
ds.field("backdrop", &self.backdrop());
ds.field("logo", &self.logo());
ds.finish()
}
}
pub enum LinkedIdOffset {}
#[derive(Copy, Clone, PartialEq)]
pub struct LinkedId<'a> {
pub _tab: ::flatbuffers::Table<'a>,
}
impl<'a> ::flatbuffers::Follow<'a> for LinkedId<'a> {
type Inner = LinkedId<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
}
}
impl<'a> LinkedId<'a> {
pub const VT_SOURCE: ::flatbuffers::VOffsetT = 4;
pub const VT_ID: ::flatbuffers::VOffsetT = 6;
#[inline]
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
LinkedId { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
args: &'args LinkedIdArgs<'args>
) -> ::flatbuffers::WIPOffset<LinkedId<'bldr>> {
let mut builder = LinkedIdBuilder::new(_fbb);
if let Some(x) = args.id { builder.add_id(x); }
if let Some(x) = args.source { builder.add_source(x); }
builder.finish()
}
#[inline]
pub fn source(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(LinkedId::VT_SOURCE, None)}
}
#[inline]
pub fn id(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(LinkedId::VT_ID, None)}
}
}
impl ::flatbuffers::Verifiable for LinkedId<'_> {
#[inline]
fn run_verifier(
v: &mut ::flatbuffers::Verifier, pos: usize
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
v.visit_table(pos)?
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("source", Self::VT_SOURCE, false)?
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, false)?
.finish();
Ok(())
}
}
pub struct LinkedIdArgs<'a> {
pub source: Option<::flatbuffers::WIPOffset<&'a str>>,
pub id: Option<::flatbuffers::WIPOffset<&'a str>>,
}
impl<'a> Default for LinkedIdArgs<'a> {
#[inline]
fn default() -> Self {
LinkedIdArgs {
source: None,
id: None,
}
}
}
pub struct LinkedIdBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> LinkedIdBuilder<'a, 'b, A> {
#[inline]
pub fn add_source(&mut self, source: ::flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(LinkedId::VT_SOURCE, source);
}
#[inline]
pub fn add_id(&mut self, id: ::flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(LinkedId::VT_ID, id);
}
#[inline]
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> LinkedIdBuilder<'a, 'b, A> {
let start = _fbb.start_table();
LinkedIdBuilder {
fbb_: _fbb,
start_: start,
}
}
#[inline]
pub fn finish(self) -> ::flatbuffers::WIPOffset<LinkedId<'a>> {
let o = self.fbb_.end_table(self.start_);
::flatbuffers::WIPOffset::new(o.value())
}
}
impl ::core::fmt::Debug for LinkedId<'_> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
let mut ds = f.debug_struct("LinkedId");
ds.field("source", &self.source());
ds.field("id", &self.id());
ds.finish()
}
}
pub enum AttrOffset {}
#[derive(Copy, Clone, PartialEq)]
pub struct Attr<'a> {
pub _tab: ::flatbuffers::Table<'a>,
}
impl<'a> ::flatbuffers::Follow<'a> for Attr<'a> {
type Inner = Attr<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
}
}
impl<'a> Attr<'a> {
pub const VT_KEY: ::flatbuffers::VOffsetT = 4;
pub const VT_VALUE: ::flatbuffers::VOffsetT = 6;
#[inline]
pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
Attr { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
_fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
args: &'args AttrArgs<'args>
) -> ::flatbuffers::WIPOffset<Attr<'bldr>> {
let mut builder = AttrBuilder::new(_fbb);
if let Some(x) = args.value { builder.add_value(x); }
if let Some(x) = args.key { builder.add_key(x); }
builder.finish()
}
#[inline]
pub fn key(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Attr::VT_KEY, None)}
}
#[inline]
pub fn value(&self) -> Option<&'a str> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(Attr::VT_VALUE, None)}
}
}
impl ::flatbuffers::Verifiable for Attr<'_> {
#[inline]
fn run_verifier(
v: &mut ::flatbuffers::Verifier, pos: usize
) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
v.visit_table(pos)?
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("key", Self::VT_KEY, false)?
.visit_field::<::flatbuffers::ForwardsUOffset<&str>>("value", Self::VT_VALUE, false)?
.finish();
Ok(())
}
}
pub struct AttrArgs<'a> {
pub key: Option<::flatbuffers::WIPOffset<&'a str>>,
pub value: Option<::flatbuffers::WIPOffset<&'a str>>,
}
impl<'a> Default for AttrArgs<'a> {
#[inline]
fn default() -> Self {
AttrArgs {
key: None,
value: None,
}
}
}
pub struct AttrBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> AttrBuilder<'a, 'b, A> {
#[inline]
pub fn add_key(&mut self, key: ::flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Attr::VT_KEY, key);
}
#[inline]
pub fn add_value(&mut self, value: ::flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Attr::VT_VALUE, value);
}
#[inline]
pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> AttrBuilder<'a, 'b, A> {
let start = _fbb.start_table();
AttrBuilder {
fbb_: _fbb,
start_: start,
}
}
#[inline]
pub fn finish(self) -> ::flatbuffers::WIPOffset<Attr<'a>> {
let o = self.fbb_.end_table(self.start_);
::flatbuffers::WIPOffset::new(o.value())
}
}
impl ::core::fmt::Debug for Attr<'_> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
let mut ds = f.debug_struct("Attr");
ds.field("key", &self.key());
ds.field("value", &self.value());
ds.finish()
}
}
#[inline]
/// Verifies that a buffer of bytes contains a `Attr`
/// and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_attr_unchecked`.
pub fn root_as_attr(buf: &[u8]) -> Result<Attr<'_>, ::flatbuffers::InvalidFlatbuffer> {
::flatbuffers::root::<Attr>(buf)
}
#[inline]
/// Verifies that a buffer of bytes contains a size prefixed
/// `Attr` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `size_prefixed_root_as_attr_unchecked`.
pub fn size_prefixed_root_as_attr(buf: &[u8]) -> Result<Attr<'_>, ::flatbuffers::InvalidFlatbuffer> {
::flatbuffers::size_prefixed_root::<Attr>(buf)
}
#[inline]
/// Verifies, with the given options, that a buffer of bytes
/// contains a `Attr` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_attr_unchecked`.
pub fn root_as_attr_with_opts<'b, 'o>(
opts: &'o ::flatbuffers::VerifierOptions,
buf: &'b [u8],
) -> Result<Attr<'b>, ::flatbuffers::InvalidFlatbuffer> {
::flatbuffers::root_with_opts::<Attr<'b>>(opts, buf)
}
#[inline]
/// Verifies, with the given verifier options, that a buffer of
/// bytes contains a size prefixed `Attr` and returns
/// it. Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_attr_unchecked`.
pub fn size_prefixed_root_as_attr_with_opts<'b, 'o>(
opts: &'o ::flatbuffers::VerifierOptions,
buf: &'b [u8],
) -> Result<Attr<'b>, ::flatbuffers::InvalidFlatbuffer> {
::flatbuffers::size_prefixed_root_with_opts::<Attr<'b>>(opts, buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a Attr and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `Attr`.
pub unsafe fn root_as_attr_unchecked(buf: &[u8]) -> Attr<'_> {
unsafe { ::flatbuffers::root_unchecked::<Attr>(buf) }
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed Attr and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid size prefixed `Attr`.
pub unsafe fn size_prefixed_root_as_attr_unchecked(buf: &[u8]) -> Attr<'_> {
unsafe { ::flatbuffers::size_prefixed_root_unchecked::<Attr>(buf) }
}
#[inline]
pub fn finish_attr_buffer<'a, 'b, A: ::flatbuffers::Allocator + 'a>(
fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
root: ::flatbuffers::WIPOffset<Attr<'a>>) {
fbb.finish(root, None);
}
#[inline]
pub fn finish_size_prefixed_attr_buffer<'a, 'b, A: ::flatbuffers::Allocator + 'a>(fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>, root: ::flatbuffers::WIPOffset<Attr<'a>>) {
fbb.finish_size_prefixed(root, None);
}
} // pub mod wire
} // pub mod bex
|