use core::mem;
use core::cmp::Ordering;
extern crate flatbuffers;
use self::flatbuffers::{EndianScalar, Follow};
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_SONAR_TYPE: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_SONAR_TYPE: 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_SONAR_TYPE: [SonarType; 11] = [
SonarType::ACTIVE_HULL,
SonarType::ACTIVE_VDS,
SonarType::ACTIVE_DIPPING,
SonarType::PASSIVE_HULL,
SonarType::PASSIVE_TOWED,
SonarType::PASSIVE_SONOBUOY,
SonarType::MINE_HUNTING,
SonarType::SIDESCAN,
SonarType::BOTTOM_PROFILER,
SonarType::INTERCEPT,
SonarType::TORPEDO,
];
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct SonarType(pub i8);
#[allow(non_upper_case_globals)]
impl SonarType {
pub const ACTIVE_HULL: Self = Self(0);
pub const ACTIVE_VDS: Self = Self(1);
pub const ACTIVE_DIPPING: Self = Self(2);
pub const PASSIVE_HULL: Self = Self(3);
pub const PASSIVE_TOWED: Self = Self(4);
pub const PASSIVE_SONOBUOY: Self = Self(5);
pub const MINE_HUNTING: Self = Self(6);
pub const SIDESCAN: Self = Self(7);
pub const BOTTOM_PROFILER: Self = Self(8);
pub const INTERCEPT: Self = Self(9);
pub const TORPEDO: Self = Self(10);
pub const ENUM_MIN: i8 = 0;
pub const ENUM_MAX: i8 = 10;
pub const ENUM_VALUES: &'static [Self] = &[
Self::ACTIVE_HULL,
Self::ACTIVE_VDS,
Self::ACTIVE_DIPPING,
Self::PASSIVE_HULL,
Self::PASSIVE_TOWED,
Self::PASSIVE_SONOBUOY,
Self::MINE_HUNTING,
Self::SIDESCAN,
Self::BOTTOM_PROFILER,
Self::INTERCEPT,
Self::TORPEDO,
];
pub fn variant_name(self) -> Option<&'static str> {
match self {
Self::ACTIVE_HULL => Some("ACTIVE_HULL"),
Self::ACTIVE_VDS => Some("ACTIVE_VDS"),
Self::ACTIVE_DIPPING => Some("ACTIVE_DIPPING"),
Self::PASSIVE_HULL => Some("PASSIVE_HULL"),
Self::PASSIVE_TOWED => Some("PASSIVE_TOWED"),
Self::PASSIVE_SONOBUOY => Some("PASSIVE_SONOBUOY"),
Self::MINE_HUNTING => Some("MINE_HUNTING"),
Self::SIDESCAN => Some("SIDESCAN"),
Self::BOTTOM_PROFILER => Some("BOTTOM_PROFILER"),
Self::INTERCEPT => Some("INTERCEPT"),
Self::TORPEDO => Some("TORPEDO"),
_ => None,
}
}
}
impl core::fmt::Debug for SonarType {
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 SonarType {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
Self(b)
}
}
impl flatbuffers::Push for SonarType {
type Output = SonarType;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
flatbuffers::emplace_scalar::<i8>(dst, self.0);
}
}
impl flatbuffers::EndianScalar for SonarType {
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 SonarType {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
i8::run_verifier(v, pos)
}
}
impl flatbuffers::SimpleToVerifyInSlice for SonarType {}
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_SONPROPAGATION_MODEL: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_SONPROPAGATION_MODEL: 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_SONPROPAGATION_MODEL: [SONPropagationModel; 6] = [
SONPropagationModel::RAY_TRACING,
SONPropagationModel::PARABOLIC_EQUATION,
SONPropagationModel::NORMAL_MODES,
SONPropagationModel::ISOVELOCITY,
SONPropagationModel::RANGE_DEPENDENT,
SONPropagationModel::FAST_FIELD,
];
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct SONPropagationModel(pub i8);
#[allow(non_upper_case_globals)]
impl SONPropagationModel {
pub const RAY_TRACING: Self = Self(0);
pub const PARABOLIC_EQUATION: Self = Self(1);
pub const NORMAL_MODES: Self = Self(2);
pub const ISOVELOCITY: Self = Self(3);
pub const RANGE_DEPENDENT: Self = Self(4);
pub const FAST_FIELD: Self = Self(5);
pub const ENUM_MIN: i8 = 0;
pub const ENUM_MAX: i8 = 5;
pub const ENUM_VALUES: &'static [Self] = &[
Self::RAY_TRACING,
Self::PARABOLIC_EQUATION,
Self::NORMAL_MODES,
Self::ISOVELOCITY,
Self::RANGE_DEPENDENT,
Self::FAST_FIELD,
];
pub fn variant_name(self) -> Option<&'static str> {
match self {
Self::RAY_TRACING => Some("RAY_TRACING"),
Self::PARABOLIC_EQUATION => Some("PARABOLIC_EQUATION"),
Self::NORMAL_MODES => Some("NORMAL_MODES"),
Self::ISOVELOCITY => Some("ISOVELOCITY"),
Self::RANGE_DEPENDENT => Some("RANGE_DEPENDENT"),
Self::FAST_FIELD => Some("FAST_FIELD"),
_ => None,
}
}
}
impl core::fmt::Debug for SONPropagationModel {
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 SONPropagationModel {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
Self(b)
}
}
impl flatbuffers::Push for SONPropagationModel {
type Output = SONPropagationModel;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
flatbuffers::emplace_scalar::<i8>(dst, self.0);
}
}
impl flatbuffers::EndianScalar for SONPropagationModel {
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 SONPropagationModel {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
i8::run_verifier(v, pos)
}
}
impl flatbuffers::SimpleToVerifyInSlice for SONPropagationModel {}
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_BOTTOM_TYPE: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_BOTTOM_TYPE: i8 = 8;
#[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_BOTTOM_TYPE: [BottomType; 9] = [
BottomType::HARD_ROCK,
BottomType::SOFT_ROCK,
BottomType::SAND,
BottomType::SILT,
BottomType::CLAY,
BottomType::MUD,
BottomType::GRAVEL,
BottomType::CORAL,
BottomType::MIXED,
];
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct BottomType(pub i8);
#[allow(non_upper_case_globals)]
impl BottomType {
pub const HARD_ROCK: Self = Self(0);
pub const SOFT_ROCK: Self = Self(1);
pub const SAND: Self = Self(2);
pub const SILT: Self = Self(3);
pub const CLAY: Self = Self(4);
pub const MUD: Self = Self(5);
pub const GRAVEL: Self = Self(6);
pub const CORAL: Self = Self(7);
pub const MIXED: Self = Self(8);
pub const ENUM_MIN: i8 = 0;
pub const ENUM_MAX: i8 = 8;
pub const ENUM_VALUES: &'static [Self] = &[
Self::HARD_ROCK,
Self::SOFT_ROCK,
Self::SAND,
Self::SILT,
Self::CLAY,
Self::MUD,
Self::GRAVEL,
Self::CORAL,
Self::MIXED,
];
pub fn variant_name(self) -> Option<&'static str> {
match self {
Self::HARD_ROCK => Some("HARD_ROCK"),
Self::SOFT_ROCK => Some("SOFT_ROCK"),
Self::SAND => Some("SAND"),
Self::SILT => Some("SILT"),
Self::CLAY => Some("CLAY"),
Self::MUD => Some("MUD"),
Self::GRAVEL => Some("GRAVEL"),
Self::CORAL => Some("CORAL"),
Self::MIXED => Some("MIXED"),
_ => None,
}
}
}
impl core::fmt::Debug for BottomType {
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 BottomType {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
Self(b)
}
}
impl flatbuffers::Push for BottomType {
type Output = BottomType;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
flatbuffers::emplace_scalar::<i8>(dst, self.0);
}
}
impl flatbuffers::EndianScalar for BottomType {
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 BottomType {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
i8::run_verifier(v, pos)
}
}
impl flatbuffers::SimpleToVerifyInSlice for BottomType {}
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_SEA_STATE: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_SEA_STATE: i8 = 9;
#[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_SEA_STATE: [SeaState; 10] = [
SeaState::SS0,
SeaState::SS1,
SeaState::SS2,
SeaState::SS3,
SeaState::SS4,
SeaState::SS5,
SeaState::SS6,
SeaState::SS7,
SeaState::SS8,
SeaState::SS9,
];
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct SeaState(pub i8);
#[allow(non_upper_case_globals)]
impl SeaState {
pub const SS0: Self = Self(0);
pub const SS1: Self = Self(1);
pub const SS2: Self = Self(2);
pub const SS3: Self = Self(3);
pub const SS4: Self = Self(4);
pub const SS5: Self = Self(5);
pub const SS6: Self = Self(6);
pub const SS7: Self = Self(7);
pub const SS8: Self = Self(8);
pub const SS9: Self = Self(9);
pub const ENUM_MIN: i8 = 0;
pub const ENUM_MAX: i8 = 9;
pub const ENUM_VALUES: &'static [Self] = &[
Self::SS0,
Self::SS1,
Self::SS2,
Self::SS3,
Self::SS4,
Self::SS5,
Self::SS6,
Self::SS7,
Self::SS8,
Self::SS9,
];
pub fn variant_name(self) -> Option<&'static str> {
match self {
Self::SS0 => Some("SS0"),
Self::SS1 => Some("SS1"),
Self::SS2 => Some("SS2"),
Self::SS3 => Some("SS3"),
Self::SS4 => Some("SS4"),
Self::SS5 => Some("SS5"),
Self::SS6 => Some("SS6"),
Self::SS7 => Some("SS7"),
Self::SS8 => Some("SS8"),
Self::SS9 => Some("SS9"),
_ => None,
}
}
}
impl core::fmt::Debug for SeaState {
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 SeaState {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
Self(b)
}
}
impl flatbuffers::Push for SeaState {
type Output = SeaState;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
flatbuffers::emplace_scalar::<i8>(dst, self.0);
}
}
impl flatbuffers::EndianScalar for SeaState {
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 SeaState {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
i8::run_verifier(v, pos)
}
}
impl flatbuffers::SimpleToVerifyInSlice for SeaState {}
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_NOISE_SOURCE: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_NOISE_SOURCE: i8 = 9;
#[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_NOISE_SOURCE: [NoiseSource; 10] = [
NoiseSource::AMBIENT,
NoiseSource::SHIPPING,
NoiseSource::BIOLOGICAL,
NoiseSource::WIND,
NoiseSource::RAIN,
NoiseSource::ICE,
NoiseSource::SEISMIC,
NoiseSource::MACHINERY,
NoiseSource::FLOW,
NoiseSource::SELF_NOISE,
];
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct NoiseSource(pub i8);
#[allow(non_upper_case_globals)]
impl NoiseSource {
pub const AMBIENT: Self = Self(0);
pub const SHIPPING: Self = Self(1);
pub const BIOLOGICAL: Self = Self(2);
pub const WIND: Self = Self(3);
pub const RAIN: Self = Self(4);
pub const ICE: Self = Self(5);
pub const SEISMIC: Self = Self(6);
pub const MACHINERY: Self = Self(7);
pub const FLOW: Self = Self(8);
pub const SELF_NOISE: Self = Self(9);
pub const ENUM_MIN: i8 = 0;
pub const ENUM_MAX: i8 = 9;
pub const ENUM_VALUES: &'static [Self] = &[
Self::AMBIENT,
Self::SHIPPING,
Self::BIOLOGICAL,
Self::WIND,
Self::RAIN,
Self::ICE,
Self::SEISMIC,
Self::MACHINERY,
Self::FLOW,
Self::SELF_NOISE,
];
pub fn variant_name(self) -> Option<&'static str> {
match self {
Self::AMBIENT => Some("AMBIENT"),
Self::SHIPPING => Some("SHIPPING"),
Self::BIOLOGICAL => Some("BIOLOGICAL"),
Self::WIND => Some("WIND"),
Self::RAIN => Some("RAIN"),
Self::ICE => Some("ICE"),
Self::SEISMIC => Some("SEISMIC"),
Self::MACHINERY => Some("MACHINERY"),
Self::FLOW => Some("FLOW"),
Self::SELF_NOISE => Some("SELF_NOISE"),
_ => None,
}
}
}
impl core::fmt::Debug for NoiseSource {
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 NoiseSource {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
Self(b)
}
}
impl flatbuffers::Push for NoiseSource {
type Output = NoiseSource;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
flatbuffers::emplace_scalar::<i8>(dst, self.0);
}
}
impl flatbuffers::EndianScalar for NoiseSource {
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 NoiseSource {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
i8::run_verifier(v, pos)
}
}
impl flatbuffers::SimpleToVerifyInSlice for NoiseSource {}
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_TARGET_TYPE: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_TARGET_TYPE: i8 = 6;
#[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_TARGET_TYPE: [TargetType; 7] = [
TargetType::SUBMARINE,
TargetType::SURFACE_SHIP,
TargetType::TORPEDO,
TargetType::MINE,
TargetType::BIOLOGICAL,
TargetType::WRECK,
TargetType::UNKNOWN,
];
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct TargetType(pub i8);
#[allow(non_upper_case_globals)]
impl TargetType {
pub const SUBMARINE: Self = Self(0);
pub const SURFACE_SHIP: Self = Self(1);
pub const TORPEDO: Self = Self(2);
pub const MINE: Self = Self(3);
pub const BIOLOGICAL: Self = Self(4);
pub const WRECK: Self = Self(5);
pub const UNKNOWN: Self = Self(6);
pub const ENUM_MIN: i8 = 0;
pub const ENUM_MAX: i8 = 6;
pub const ENUM_VALUES: &'static [Self] = &[
Self::SUBMARINE,
Self::SURFACE_SHIP,
Self::TORPEDO,
Self::MINE,
Self::BIOLOGICAL,
Self::WRECK,
Self::UNKNOWN,
];
pub fn variant_name(self) -> Option<&'static str> {
match self {
Self::SUBMARINE => Some("SUBMARINE"),
Self::SURFACE_SHIP => Some("SURFACE_SHIP"),
Self::TORPEDO => Some("TORPEDO"),
Self::MINE => Some("MINE"),
Self::BIOLOGICAL => Some("BIOLOGICAL"),
Self::WRECK => Some("WRECK"),
Self::UNKNOWN => Some("UNKNOWN"),
_ => None,
}
}
}
impl core::fmt::Debug for TargetType {
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 TargetType {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
Self(b)
}
}
impl flatbuffers::Push for TargetType {
type Output = TargetType;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
flatbuffers::emplace_scalar::<i8>(dst, self.0);
}
}
impl flatbuffers::EndianScalar for TargetType {
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 TargetType {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
i8::run_verifier(v, pos)
}
}
impl flatbuffers::SimpleToVerifyInSlice for TargetType {}
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_TORPEDO_GUIDANCE_MODE: i8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_TORPEDO_GUIDANCE_MODE: i8 = 6;
#[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_TORPEDO_GUIDANCE_MODE: [TorpedoGuidanceMode; 7] = [
TorpedoGuidanceMode::WIRE_GUIDED,
TorpedoGuidanceMode::ACTIVE_HOMING,
TorpedoGuidanceMode::PASSIVE_HOMING,
TorpedoGuidanceMode::WAKE_HOMING,
TorpedoGuidanceMode::PATTERN_SEARCH,
TorpedoGuidanceMode::SNAKE_SEARCH,
TorpedoGuidanceMode::CEILING_BOUNCE,
];
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct TorpedoGuidanceMode(pub i8);
#[allow(non_upper_case_globals)]
impl TorpedoGuidanceMode {
pub const WIRE_GUIDED: Self = Self(0);
pub const ACTIVE_HOMING: Self = Self(1);
pub const PASSIVE_HOMING: Self = Self(2);
pub const WAKE_HOMING: Self = Self(3);
pub const PATTERN_SEARCH: Self = Self(4);
pub const SNAKE_SEARCH: Self = Self(5);
pub const CEILING_BOUNCE: Self = Self(6);
pub const ENUM_MIN: i8 = 0;
pub const ENUM_MAX: i8 = 6;
pub const ENUM_VALUES: &'static [Self] = &[
Self::WIRE_GUIDED,
Self::ACTIVE_HOMING,
Self::PASSIVE_HOMING,
Self::WAKE_HOMING,
Self::PATTERN_SEARCH,
Self::SNAKE_SEARCH,
Self::CEILING_BOUNCE,
];
pub fn variant_name(self) -> Option<&'static str> {
match self {
Self::WIRE_GUIDED => Some("WIRE_GUIDED"),
Self::ACTIVE_HOMING => Some("ACTIVE_HOMING"),
Self::PASSIVE_HOMING => Some("PASSIVE_HOMING"),
Self::WAKE_HOMING => Some("WAKE_HOMING"),
Self::PATTERN_SEARCH => Some("PATTERN_SEARCH"),
Self::SNAKE_SEARCH => Some("SNAKE_SEARCH"),
Self::CEILING_BOUNCE => Some("CEILING_BOUNCE"),
_ => None,
}
}
}
impl core::fmt::Debug for TorpedoGuidanceMode {
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 TorpedoGuidanceMode {
type Inner = Self;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
Self(b)
}
}
impl flatbuffers::Push for TorpedoGuidanceMode {
type Output = TorpedoGuidanceMode;
#[inline]
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
flatbuffers::emplace_scalar::<i8>(dst, self.0);
}
}
impl flatbuffers::EndianScalar for TorpedoGuidanceMode {
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 TorpedoGuidanceMode {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
i8::run_verifier(v, pos)
}
}
impl flatbuffers::SimpleToVerifyInSlice for TorpedoGuidanceMode {}
pub enum SONOffset {}
#[derive(Copy, Clone, PartialEq)]
pub struct SON<'a> {
pub _tab: flatbuffers::Table<'a>,
}
impl<'a> flatbuffers::Follow<'a> for SON<'a> {
type Inner = SON<'a>;
#[inline]
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self { _tab: flatbuffers::Table::new(buf, loc) }
}
}
impl<'a> SON<'a> {
pub const VT_COMMAND: flatbuffers::VOffsetT = 4;
pub const VT_ACTIVE_CONFIG: flatbuffers::VOffsetT = 6;
pub const VT_PASSIVE_CONFIG: flatbuffers::VOffsetT = 8;
pub const VT_TL_REQUEST: flatbuffers::VOffsetT = 10;
pub const VT_ENVIRONMENT: flatbuffers::VOffsetT = 12;
pub const VT_TARGET_SIGNATURE: flatbuffers::VOffsetT = 14;
pub const VT_TMA_INPUT: flatbuffers::VOffsetT = 16;
pub const VT_TORPEDO_SEEKER: flatbuffers::VOffsetT = 18;
#[inline]
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
SON { _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 SONArgs<'args>
) -> flatbuffers::WIPOffset<SON<'bldr>> {
let mut builder = SONBuilder::new(_fbb);
if let Some(x) = args.TORPEDO_SEEKER { builder.add_TORPEDO_SEEKER(x); }
if let Some(x) = args.TMA_INPUT { builder.add_TMA_INPUT(x); }
if let Some(x) = args.TARGET_SIGNATURE { builder.add_TARGET_SIGNATURE(x); }
if let Some(x) = args.ENVIRONMENT { builder.add_ENVIRONMENT(x); }
if let Some(x) = args.TL_REQUEST { builder.add_TL_REQUEST(x); }
if let Some(x) = args.PASSIVE_CONFIG { builder.add_PASSIVE_CONFIG(x); }
if let Some(x) = args.ACTIVE_CONFIG { builder.add_ACTIVE_CONFIG(x); }
if let Some(x) = args.COMMAND { builder.add_COMMAND(x); }
builder.finish()
}
pub fn unpack(&self) -> SONT {
let COMMAND = self.COMMAND().map(|x| {
x.to_string()
});
let ACTIVE_CONFIG = self.ACTIVE_CONFIG().map(|x| {
x.to_string()
});
let PASSIVE_CONFIG = self.PASSIVE_CONFIG().map(|x| {
x.to_string()
});
let TL_REQUEST = self.TL_REQUEST().map(|x| {
x.to_string()
});
let ENVIRONMENT = self.ENVIRONMENT().map(|x| {
x.to_string()
});
let TARGET_SIGNATURE = self.TARGET_SIGNATURE().map(|x| {
x.to_string()
});
let TMA_INPUT = self.TMA_INPUT().map(|x| {
x.to_string()
});
let TORPEDO_SEEKER = self.TORPEDO_SEEKER().map(|x| {
x.to_string()
});
SONT {
COMMAND,
ACTIVE_CONFIG,
PASSIVE_CONFIG,
TL_REQUEST,
ENVIRONMENT,
TARGET_SIGNATURE,
TMA_INPUT,
TORPEDO_SEEKER,
}
}
#[inline]
pub fn COMMAND(&self) -> Option<&'a str> {
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SON::VT_COMMAND, None)}
}
#[inline]
pub fn ACTIVE_CONFIG(&self) -> Option<&'a str> {
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SON::VT_ACTIVE_CONFIG, None)}
}
#[inline]
pub fn PASSIVE_CONFIG(&self) -> Option<&'a str> {
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SON::VT_PASSIVE_CONFIG, None)}
}
#[inline]
pub fn TL_REQUEST(&self) -> Option<&'a str> {
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SON::VT_TL_REQUEST, None)}
}
#[inline]
pub fn ENVIRONMENT(&self) -> Option<&'a str> {
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SON::VT_ENVIRONMENT, None)}
}
#[inline]
pub fn TARGET_SIGNATURE(&self) -> Option<&'a str> {
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SON::VT_TARGET_SIGNATURE, None)}
}
#[inline]
pub fn TMA_INPUT(&self) -> Option<&'a str> {
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SON::VT_TMA_INPUT, None)}
}
#[inline]
pub fn TORPEDO_SEEKER(&self) -> Option<&'a str> {
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(SON::VT_TORPEDO_SEEKER, None)}
}
}
impl flatbuffers::Verifiable for SON<'_> {
#[inline]
fn run_verifier(
v: &mut flatbuffers::Verifier, pos: usize
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
use self::flatbuffers::Verifiable;
v.visit_table(pos)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("COMMAND", Self::VT_COMMAND, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("ACTIVE_CONFIG", Self::VT_ACTIVE_CONFIG, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("PASSIVE_CONFIG", Self::VT_PASSIVE_CONFIG, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("TL_REQUEST", Self::VT_TL_REQUEST, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("ENVIRONMENT", Self::VT_ENVIRONMENT, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("TARGET_SIGNATURE", Self::VT_TARGET_SIGNATURE, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("TMA_INPUT", Self::VT_TMA_INPUT, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("TORPEDO_SEEKER", Self::VT_TORPEDO_SEEKER, false)?
.finish();
Ok(())
}
}
pub struct SONArgs<'a> {
pub COMMAND: Option<flatbuffers::WIPOffset<&'a str>>,
pub ACTIVE_CONFIG: Option<flatbuffers::WIPOffset<&'a str>>,
pub PASSIVE_CONFIG: Option<flatbuffers::WIPOffset<&'a str>>,
pub TL_REQUEST: Option<flatbuffers::WIPOffset<&'a str>>,
pub ENVIRONMENT: Option<flatbuffers::WIPOffset<&'a str>>,
pub TARGET_SIGNATURE: Option<flatbuffers::WIPOffset<&'a str>>,
pub TMA_INPUT: Option<flatbuffers::WIPOffset<&'a str>>,
pub TORPEDO_SEEKER: Option<flatbuffers::WIPOffset<&'a str>>,
}
impl<'a> Default for SONArgs<'a> {
#[inline]
fn default() -> Self {
SONArgs {
COMMAND: None,
ACTIVE_CONFIG: None,
PASSIVE_CONFIG: None,
TL_REQUEST: None,
ENVIRONMENT: None,
TARGET_SIGNATURE: None,
TMA_INPUT: None,
TORPEDO_SEEKER: None,
}
}
}
pub struct SONBuilder<'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> SONBuilder<'a, 'b, A> {
#[inline]
pub fn add_COMMAND(&mut self, COMMAND: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SON::VT_COMMAND, COMMAND);
}
#[inline]
pub fn add_ACTIVE_CONFIG(&mut self, ACTIVE_CONFIG: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SON::VT_ACTIVE_CONFIG, ACTIVE_CONFIG);
}
#[inline]
pub fn add_PASSIVE_CONFIG(&mut self, PASSIVE_CONFIG: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SON::VT_PASSIVE_CONFIG, PASSIVE_CONFIG);
}
#[inline]
pub fn add_TL_REQUEST(&mut self, TL_REQUEST: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SON::VT_TL_REQUEST, TL_REQUEST);
}
#[inline]
pub fn add_ENVIRONMENT(&mut self, ENVIRONMENT: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SON::VT_ENVIRONMENT, ENVIRONMENT);
}
#[inline]
pub fn add_TARGET_SIGNATURE(&mut self, TARGET_SIGNATURE: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SON::VT_TARGET_SIGNATURE, TARGET_SIGNATURE);
}
#[inline]
pub fn add_TMA_INPUT(&mut self, TMA_INPUT: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SON::VT_TMA_INPUT, TMA_INPUT);
}
#[inline]
pub fn add_TORPEDO_SEEKER(&mut self, TORPEDO_SEEKER: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(SON::VT_TORPEDO_SEEKER, TORPEDO_SEEKER);
}
#[inline]
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> SONBuilder<'a, 'b, A> {
let start = _fbb.start_table();
SONBuilder {
fbb_: _fbb,
start_: start,
}
}
#[inline]
pub fn finish(self) -> flatbuffers::WIPOffset<SON<'a>> {
let o = self.fbb_.end_table(self.start_);
flatbuffers::WIPOffset::new(o.value())
}
}
impl core::fmt::Debug for SON<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let mut ds = f.debug_struct("SON");
ds.field("COMMAND", &self.COMMAND());
ds.field("ACTIVE_CONFIG", &self.ACTIVE_CONFIG());
ds.field("PASSIVE_CONFIG", &self.PASSIVE_CONFIG());
ds.field("TL_REQUEST", &self.TL_REQUEST());
ds.field("ENVIRONMENT", &self.ENVIRONMENT());
ds.field("TARGET_SIGNATURE", &self.TARGET_SIGNATURE());
ds.field("TMA_INPUT", &self.TMA_INPUT());
ds.field("TORPEDO_SEEKER", &self.TORPEDO_SEEKER());
ds.finish()
}
}
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]
pub struct SONT {
pub COMMAND: Option<String>,
pub ACTIVE_CONFIG: Option<String>,
pub PASSIVE_CONFIG: Option<String>,
pub TL_REQUEST: Option<String>,
pub ENVIRONMENT: Option<String>,
pub TARGET_SIGNATURE: Option<String>,
pub TMA_INPUT: Option<String>,
pub TORPEDO_SEEKER: Option<String>,
}
impl Default for SONT {
fn default() -> Self {
Self {
COMMAND: None,
ACTIVE_CONFIG: None,
PASSIVE_CONFIG: None,
TL_REQUEST: None,
ENVIRONMENT: None,
TARGET_SIGNATURE: None,
TMA_INPUT: None,
TORPEDO_SEEKER: None,
}
}
}
impl SONT {
pub fn pack<'b, A: flatbuffers::Allocator + 'b>(
&self,
_fbb: &mut flatbuffers::FlatBufferBuilder<'b, A>
) -> flatbuffers::WIPOffset<SON<'b>> {
let COMMAND = self.COMMAND.as_ref().map(|x|{
_fbb.create_string(x)
});
let ACTIVE_CONFIG = self.ACTIVE_CONFIG.as_ref().map(|x|{
_fbb.create_string(x)
});
let PASSIVE_CONFIG = self.PASSIVE_CONFIG.as_ref().map(|x|{
_fbb.create_string(x)
});
let TL_REQUEST = self.TL_REQUEST.as_ref().map(|x|{
_fbb.create_string(x)
});
let ENVIRONMENT = self.ENVIRONMENT.as_ref().map(|x|{
_fbb.create_string(x)
});
let TARGET_SIGNATURE = self.TARGET_SIGNATURE.as_ref().map(|x|{
_fbb.create_string(x)
});
let TMA_INPUT = self.TMA_INPUT.as_ref().map(|x|{
_fbb.create_string(x)
});
let TORPEDO_SEEKER = self.TORPEDO_SEEKER.as_ref().map(|x|{
_fbb.create_string(x)
});
SON::create(_fbb, &SONArgs{
COMMAND,
ACTIVE_CONFIG,
PASSIVE_CONFIG,
TL_REQUEST,
ENVIRONMENT,
TARGET_SIGNATURE,
TMA_INPUT,
TORPEDO_SEEKER,
})
}
}
#[inline]
pub fn root_as_SON(buf: &[u8]) -> Result<SON, flatbuffers::InvalidFlatbuffer> {
flatbuffers::root::<SON>(buf)
}
#[inline]
pub fn size_prefixed_root_as_SON(buf: &[u8]) -> Result<SON, flatbuffers::InvalidFlatbuffer> {
flatbuffers::size_prefixed_root::<SON>(buf)
}
#[inline]
pub fn root_as_SON_with_opts<'b, 'o>(
opts: &'o flatbuffers::VerifierOptions,
buf: &'b [u8],
) -> Result<SON<'b>, flatbuffers::InvalidFlatbuffer> {
flatbuffers::root_with_opts::<SON<'b>>(opts, buf)
}
#[inline]
pub fn size_prefixed_root_as_SON_with_opts<'b, 'o>(
opts: &'o flatbuffers::VerifierOptions,
buf: &'b [u8],
) -> Result<SON<'b>, flatbuffers::InvalidFlatbuffer> {
flatbuffers::size_prefixed_root_with_opts::<SON<'b>>(opts, buf)
}
#[inline]
pub unsafe fn root_as_SON_unchecked(buf: &[u8]) -> SON {
flatbuffers::root_unchecked::<SON>(buf)
}
#[inline]
pub unsafe fn size_prefixed_root_as_SON_unchecked(buf: &[u8]) -> SON {
flatbuffers::size_prefixed_root_unchecked::<SON>(buf)
}
pub const SON_IDENTIFIER: &str = "$SON";
#[inline]
pub fn SON_buffer_has_identifier(buf: &[u8]) -> bool {
flatbuffers::buffer_has_identifier(buf, SON_IDENTIFIER, false)
}
#[inline]
pub fn SON_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool {
flatbuffers::buffer_has_identifier(buf, SON_IDENTIFIER, true)
}
#[inline]
pub fn finish_SON_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
root: flatbuffers::WIPOffset<SON<'a>>) {
fbb.finish(root, Some(SON_IDENTIFIER));
}
#[inline]
pub fn finish_size_prefixed_SON_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, root: flatbuffers::WIPOffset<SON<'a>>) {
fbb.finish_size_prefixed(root, Some(SON_IDENTIFIER));
}