nostrdb: port everything over to be in as sync as possible
for now
This commit is contained in:
committed by
Daniel D’Aquino
parent
954f48b23d
commit
1fb88a912a
@@ -5,9 +5,9 @@
|
||||
|
||||
/* Common FlatBuffers build functionality for C. */
|
||||
|
||||
#include "flatcc_prologue.h"
|
||||
#include "flatcc/flatcc_prologue.h"
|
||||
#ifndef FLATBUILDER_H
|
||||
#include "flatcc_builder.h"
|
||||
#include "flatcc/flatcc_builder.h"
|
||||
#endif
|
||||
typedef flatcc_builder_t flatbuffers_builder_t;
|
||||
typedef flatcc_builder_ref_t flatbuffers_ref_t;
|
||||
@@ -681,5 +681,5 @@ __flatbuffers_build_scalar(flatbuffers_, flatbuffers_double, double)
|
||||
__flatbuffers_build_string(flatbuffers_)
|
||||
|
||||
__flatbuffers_build_buffer(flatbuffers_)
|
||||
#include "flatcc_epilogue.h"
|
||||
#include "flatcc/flatcc_epilogue.h"
|
||||
#endif /* FLATBUFFERS_COMMON_BUILDER_H */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
/* Common FlatBuffers read functionality for C. */
|
||||
|
||||
#include "flatcc_prologue.h"
|
||||
#include "flatcc_flatbuffers.h"
|
||||
#include "flatcc/flatcc_prologue.h"
|
||||
#include "flatcc/flatcc_flatbuffers.h"
|
||||
|
||||
|
||||
#define __flatbuffers_read_scalar_at_byteoffset(N, p, o) N ## _read_from_pe((uint8_t *)(p) + (o))
|
||||
@@ -574,5 +574,5 @@ static inline N ## _ ## K ## t N ## _as_typed_root(const void *buffer__tmp)\
|
||||
#define __flatbuffers_struct_as_root(N) __flatbuffers_buffer_as_root(N, struct_)
|
||||
#define __flatbuffers_table_as_root(N) __flatbuffers_buffer_as_root(N, table_)
|
||||
|
||||
#include "flatcc_epilogue.h"
|
||||
#include "flatcc/flatcc_epilogue.h"
|
||||
#endif /* FLATBUFFERS_COMMON_H */
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef FLATBUFFERS_COMMON_BUILDER_H
|
||||
#include "flatbuffers_common_builder.h"
|
||||
#endif
|
||||
#include "flatcc_prologue.h"
|
||||
#include "flatcc/flatcc_prologue.h"
|
||||
#ifndef flatbuffers_identifier
|
||||
#define flatbuffers_identifier 0
|
||||
#endif
|
||||
@@ -65,5 +65,5 @@ static NdbEventMeta_ref_t NdbEventMeta_clone(flatbuffers_builder_t *B, NdbEventM
|
||||
__flatbuffers_memoize_end(B, t, NdbEventMeta_end(B));
|
||||
}
|
||||
|
||||
#include "flatcc_epilogue.h"
|
||||
#include "flatcc/flatcc_epilogue.h"
|
||||
#endif /* META_BUILDER_H */
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
/* Generated by flatcc 0.6.1 FlatBuffers schema compiler for C by dvide.com */
|
||||
|
||||
#include "flatcc_json_parser.h"
|
||||
#include "flatcc_prologue.h"
|
||||
#include "flatcc/flatcc_json_parser.h"
|
||||
#include "flatcc/flatcc_prologue.h"
|
||||
|
||||
/*
|
||||
* Parses the default root table or struct of the schema and constructs a FlatBuffer.
|
||||
@@ -246,5 +246,5 @@ static int meta_parse_json(flatcc_builder_t *B, flatcc_json_parser_t *ctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "flatcc_epilogue.h"
|
||||
#include "flatcc/flatcc_epilogue.h"
|
||||
#endif /* META_JSON_PARSER_H */
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
#ifndef FLATBUFFERS_COMMON_READER_H
|
||||
#include "flatbuffers_common_reader.h"
|
||||
#endif
|
||||
#include "flatcc_flatbuffers.h"
|
||||
#include "flatcc/flatcc_flatbuffers.h"
|
||||
#ifndef __alignas_is_defined
|
||||
#include <stdalign.h>
|
||||
#endif
|
||||
#include "flatcc_prologue.h"
|
||||
#include "flatcc/flatcc_prologue.h"
|
||||
#ifndef flatbuffers_identifier
|
||||
#define flatbuffers_identifier 0
|
||||
#endif
|
||||
@@ -54,5 +54,5 @@ __flatbuffers_define_scalar_field(4, NdbEventMeta, zaps, flatbuffers_int32, int3
|
||||
__flatbuffers_define_scalar_field(5, NdbEventMeta, zap_total, flatbuffers_int64, int64_t, INT64_C(0))
|
||||
|
||||
|
||||
#include "flatcc_epilogue.h"
|
||||
#include "flatcc/flatcc_epilogue.h"
|
||||
#endif /* META_READER_H */
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#ifndef META_READER_H
|
||||
#include "meta_reader.h"
|
||||
#endif
|
||||
#include "flatcc_verifier.h"
|
||||
#include "flatcc_prologue.h"
|
||||
#include "flatcc/flatcc_verifier.h"
|
||||
#include "flatcc/flatcc_prologue.h"
|
||||
|
||||
static int NdbEventMeta_verify_table(flatcc_table_verifier_descriptor_t *td);
|
||||
|
||||
@@ -43,5 +43,5 @@ static inline int NdbEventMeta_verify_as_root_with_type_hash(const void *buf, si
|
||||
return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &NdbEventMeta_verify_table);
|
||||
}
|
||||
|
||||
#include "flatcc_epilogue.h"
|
||||
#include "flatcc/flatcc_epilogue.h"
|
||||
#endif /* META_VERIFIER_H */
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef FLATBUFFERS_COMMON_BUILDER_H
|
||||
#include "flatbuffers_common_builder.h"
|
||||
#endif
|
||||
#include "flatcc_prologue.h"
|
||||
#include "flatcc/flatcc_prologue.h"
|
||||
#ifndef flatbuffers_identifier
|
||||
#define flatbuffers_identifier 0
|
||||
#endif
|
||||
@@ -127,5 +127,5 @@ static NdbProfileRecord_ref_t NdbProfileRecord_clone(flatbuffers_builder_t *B, N
|
||||
__flatbuffers_memoize_end(B, t, NdbProfileRecord_end(B));
|
||||
}
|
||||
|
||||
#include "flatcc_epilogue.h"
|
||||
#include "flatcc/flatcc_epilogue.h"
|
||||
#endif /* PROFILE_BUILDER_H */
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
/* Generated by flatcc 0.6.1 FlatBuffers schema compiler for C by dvide.com */
|
||||
|
||||
#include "flatcc_json_parser.h"
|
||||
#include "flatcc_prologue.h"
|
||||
#include "flatcc/flatcc_json_parser.h"
|
||||
#include "flatcc/flatcc_prologue.h"
|
||||
|
||||
/*
|
||||
* Parses the default root table or struct of the schema and constructs a FlatBuffer.
|
||||
@@ -408,5 +408,5 @@ static int profile_parse_json(flatcc_builder_t *B, flatcc_json_parser_t *ctx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "flatcc_epilogue.h"
|
||||
#include "flatcc/flatcc_epilogue.h"
|
||||
#endif /* PROFILE_JSON_PARSER_H */
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
#ifndef FLATBUFFERS_COMMON_READER_H
|
||||
#include "flatbuffers_common_reader.h"
|
||||
#endif
|
||||
#include "flatcc_flatbuffers.h"
|
||||
#include "flatcc/flatcc_flatbuffers.h"
|
||||
#ifndef __alignas_is_defined
|
||||
#include <stdalign.h>
|
||||
#endif
|
||||
#include "flatcc_prologue.h"
|
||||
#include "flatcc/flatcc_prologue.h"
|
||||
#ifndef flatbuffers_identifier
|
||||
#define flatbuffers_identifier 0
|
||||
#endif
|
||||
@@ -89,5 +89,5 @@ __flatbuffers_define_scalar_field(2, NdbProfileRecord, note_key, flatbuffers_uin
|
||||
__flatbuffers_define_string_field(3, NdbProfileRecord, lnurl, 0)
|
||||
|
||||
|
||||
#include "flatcc_epilogue.h"
|
||||
#include "flatcc/flatcc_epilogue.h"
|
||||
#endif /* PROFILE_READER_H */
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#ifndef PROFILE_READER_H
|
||||
#include "profile_reader.h"
|
||||
#endif
|
||||
#include "flatcc_verifier.h"
|
||||
#include "flatcc_prologue.h"
|
||||
#include "flatcc/flatcc_verifier.h"
|
||||
#include "flatcc/flatcc_prologue.h"
|
||||
|
||||
static int NdbProfile_verify_table(flatcc_table_verifier_descriptor_t *td);
|
||||
static int NdbProfileRecord_verify_table(flatcc_table_verifier_descriptor_t *td);
|
||||
@@ -80,5 +80,5 @@ static inline int NdbProfileRecord_verify_as_root_with_type_hash(const void *buf
|
||||
return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &NdbProfileRecord_verify_table);
|
||||
}
|
||||
|
||||
#include "flatcc_epilogue.h"
|
||||
#include "flatcc/flatcc_epilogue.h"
|
||||
#endif /* PROFILE_VERIFIER_H */
|
||||
|
||||
0
nostrdb/bindings/rust/.dir
Normal file
0
nostrdb/bindings/rust/.dir
Normal file
264
nostrdb/bindings/rust/ndb_meta.rs
Normal file
264
nostrdb/bindings/rust/ndb_meta.rs
Normal file
@@ -0,0 +1,264 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
|
||||
// @generated
|
||||
|
||||
use core::mem;
|
||||
use core::cmp::Ordering;
|
||||
|
||||
extern crate flatbuffers;
|
||||
use self::flatbuffers::{EndianScalar, Follow};
|
||||
|
||||
pub enum NdbEventMetaOffset {}
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
|
||||
pub struct NdbEventMeta<'a> {
|
||||
pub _tab: flatbuffers::Table<'a>,
|
||||
}
|
||||
|
||||
impl<'a> flatbuffers::Follow<'a> for NdbEventMeta<'a> {
|
||||
type Inner = NdbEventMeta<'a>;
|
||||
#[inline]
|
||||
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
||||
Self { _tab: flatbuffers::Table::new(buf, loc) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> NdbEventMeta<'a> {
|
||||
pub const VT_RECEIVED_AT: flatbuffers::VOffsetT = 4;
|
||||
pub const VT_REACTIONS: flatbuffers::VOffsetT = 6;
|
||||
pub const VT_QUOTES: flatbuffers::VOffsetT = 8;
|
||||
pub const VT_REPOSTS: flatbuffers::VOffsetT = 10;
|
||||
pub const VT_ZAPS: flatbuffers::VOffsetT = 12;
|
||||
pub const VT_ZAP_TOTAL: flatbuffers::VOffsetT = 14;
|
||||
|
||||
#[inline]
|
||||
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
|
||||
NdbEventMeta { _tab: table }
|
||||
}
|
||||
#[allow(unused_mut)]
|
||||
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
|
||||
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
|
||||
args: &'args NdbEventMetaArgs
|
||||
) -> flatbuffers::WIPOffset<NdbEventMeta<'bldr>> {
|
||||
let mut builder = NdbEventMetaBuilder::new(_fbb);
|
||||
builder.add_zap_total(args.zap_total);
|
||||
builder.add_zaps(args.zaps);
|
||||
builder.add_reposts(args.reposts);
|
||||
builder.add_quotes(args.quotes);
|
||||
builder.add_reactions(args.reactions);
|
||||
builder.add_received_at(args.received_at);
|
||||
builder.finish()
|
||||
}
|
||||
|
||||
|
||||
#[inline]
|
||||
pub fn received_at(&self) -> i32 {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<i32>(NdbEventMeta::VT_RECEIVED_AT, Some(0)).unwrap()}
|
||||
}
|
||||
#[inline]
|
||||
pub fn reactions(&self) -> i32 {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<i32>(NdbEventMeta::VT_REACTIONS, Some(0)).unwrap()}
|
||||
}
|
||||
#[inline]
|
||||
pub fn quotes(&self) -> i32 {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<i32>(NdbEventMeta::VT_QUOTES, Some(0)).unwrap()}
|
||||
}
|
||||
#[inline]
|
||||
pub fn reposts(&self) -> i32 {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<i32>(NdbEventMeta::VT_REPOSTS, Some(0)).unwrap()}
|
||||
}
|
||||
#[inline]
|
||||
pub fn zaps(&self) -> i32 {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<i32>(NdbEventMeta::VT_ZAPS, Some(0)).unwrap()}
|
||||
}
|
||||
#[inline]
|
||||
pub fn zap_total(&self) -> i64 {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<i64>(NdbEventMeta::VT_ZAP_TOTAL, Some(0)).unwrap()}
|
||||
}
|
||||
}
|
||||
|
||||
impl flatbuffers::Verifiable for NdbEventMeta<'_> {
|
||||
#[inline]
|
||||
fn run_verifier(
|
||||
v: &mut flatbuffers::Verifier, pos: usize
|
||||
) -> Result<(), flatbuffers::InvalidFlatbuffer> {
|
||||
use self::flatbuffers::Verifiable;
|
||||
v.visit_table(pos)?
|
||||
.visit_field::<i32>("received_at", Self::VT_RECEIVED_AT, false)?
|
||||
.visit_field::<i32>("reactions", Self::VT_REACTIONS, false)?
|
||||
.visit_field::<i32>("quotes", Self::VT_QUOTES, false)?
|
||||
.visit_field::<i32>("reposts", Self::VT_REPOSTS, false)?
|
||||
.visit_field::<i32>("zaps", Self::VT_ZAPS, false)?
|
||||
.visit_field::<i64>("zap_total", Self::VT_ZAP_TOTAL, false)?
|
||||
.finish();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
pub struct NdbEventMetaArgs {
|
||||
pub received_at: i32,
|
||||
pub reactions: i32,
|
||||
pub quotes: i32,
|
||||
pub reposts: i32,
|
||||
pub zaps: i32,
|
||||
pub zap_total: i64,
|
||||
}
|
||||
impl<'a> Default for NdbEventMetaArgs {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
NdbEventMetaArgs {
|
||||
received_at: 0,
|
||||
reactions: 0,
|
||||
quotes: 0,
|
||||
reposts: 0,
|
||||
zaps: 0,
|
||||
zap_total: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct NdbEventMetaBuilder<'a: 'b, 'b> {
|
||||
fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
|
||||
start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
|
||||
}
|
||||
impl<'a: 'b, 'b> NdbEventMetaBuilder<'a, 'b> {
|
||||
#[inline]
|
||||
pub fn add_received_at(&mut self, received_at: i32) {
|
||||
self.fbb_.push_slot::<i32>(NdbEventMeta::VT_RECEIVED_AT, received_at, 0);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_reactions(&mut self, reactions: i32) {
|
||||
self.fbb_.push_slot::<i32>(NdbEventMeta::VT_REACTIONS, reactions, 0);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_quotes(&mut self, quotes: i32) {
|
||||
self.fbb_.push_slot::<i32>(NdbEventMeta::VT_QUOTES, quotes, 0);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_reposts(&mut self, reposts: i32) {
|
||||
self.fbb_.push_slot::<i32>(NdbEventMeta::VT_REPOSTS, reposts, 0);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_zaps(&mut self, zaps: i32) {
|
||||
self.fbb_.push_slot::<i32>(NdbEventMeta::VT_ZAPS, zaps, 0);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_zap_total(&mut self, zap_total: i64) {
|
||||
self.fbb_.push_slot::<i64>(NdbEventMeta::VT_ZAP_TOTAL, zap_total, 0);
|
||||
}
|
||||
#[inline]
|
||||
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> NdbEventMetaBuilder<'a, 'b> {
|
||||
let start = _fbb.start_table();
|
||||
NdbEventMetaBuilder {
|
||||
fbb_: _fbb,
|
||||
start_: start,
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn finish(self) -> flatbuffers::WIPOffset<NdbEventMeta<'a>> {
|
||||
let o = self.fbb_.end_table(self.start_);
|
||||
flatbuffers::WIPOffset::new(o.value())
|
||||
}
|
||||
}
|
||||
|
||||
impl core::fmt::Debug for NdbEventMeta<'_> {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
let mut ds = f.debug_struct("NdbEventMeta");
|
||||
ds.field("received_at", &self.received_at());
|
||||
ds.field("reactions", &self.reactions());
|
||||
ds.field("quotes", &self.quotes());
|
||||
ds.field("reposts", &self.reposts());
|
||||
ds.field("zaps", &self.zaps());
|
||||
ds.field("zap_total", &self.zap_total());
|
||||
ds.finish()
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
/// Verifies that a buffer of bytes contains a `NdbEventMeta`
|
||||
/// 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_ndb_event_meta_unchecked`.
|
||||
pub fn root_as_ndb_event_meta(buf: &[u8]) -> Result<NdbEventMeta, flatbuffers::InvalidFlatbuffer> {
|
||||
flatbuffers::root::<NdbEventMeta>(buf)
|
||||
}
|
||||
#[inline]
|
||||
/// Verifies that a buffer of bytes contains a size prefixed
|
||||
/// `NdbEventMeta` 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_ndb_event_meta_unchecked`.
|
||||
pub fn size_prefixed_root_as_ndb_event_meta(buf: &[u8]) -> Result<NdbEventMeta, flatbuffers::InvalidFlatbuffer> {
|
||||
flatbuffers::size_prefixed_root::<NdbEventMeta>(buf)
|
||||
}
|
||||
#[inline]
|
||||
/// Verifies, with the given options, that a buffer of bytes
|
||||
/// contains a `NdbEventMeta` 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_ndb_event_meta_unchecked`.
|
||||
pub fn root_as_ndb_event_meta_with_opts<'b, 'o>(
|
||||
opts: &'o flatbuffers::VerifierOptions,
|
||||
buf: &'b [u8],
|
||||
) -> Result<NdbEventMeta<'b>, flatbuffers::InvalidFlatbuffer> {
|
||||
flatbuffers::root_with_opts::<NdbEventMeta<'b>>(opts, buf)
|
||||
}
|
||||
#[inline]
|
||||
/// Verifies, with the given verifier options, that a buffer of
|
||||
/// bytes contains a size prefixed `NdbEventMeta` 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_ndb_event_meta_unchecked`.
|
||||
pub fn size_prefixed_root_as_ndb_event_meta_with_opts<'b, 'o>(
|
||||
opts: &'o flatbuffers::VerifierOptions,
|
||||
buf: &'b [u8],
|
||||
) -> Result<NdbEventMeta<'b>, flatbuffers::InvalidFlatbuffer> {
|
||||
flatbuffers::size_prefixed_root_with_opts::<NdbEventMeta<'b>>(opts, buf)
|
||||
}
|
||||
#[inline]
|
||||
/// Assumes, without verification, that a buffer of bytes contains a NdbEventMeta and returns it.
|
||||
/// # Safety
|
||||
/// Callers must trust the given bytes do indeed contain a valid `NdbEventMeta`.
|
||||
pub unsafe fn root_as_ndb_event_meta_unchecked(buf: &[u8]) -> NdbEventMeta {
|
||||
flatbuffers::root_unchecked::<NdbEventMeta>(buf)
|
||||
}
|
||||
#[inline]
|
||||
/// Assumes, without verification, that a buffer of bytes contains a size prefixed NdbEventMeta and returns it.
|
||||
/// # Safety
|
||||
/// Callers must trust the given bytes do indeed contain a valid size prefixed `NdbEventMeta`.
|
||||
pub unsafe fn size_prefixed_root_as_ndb_event_meta_unchecked(buf: &[u8]) -> NdbEventMeta {
|
||||
flatbuffers::size_prefixed_root_unchecked::<NdbEventMeta>(buf)
|
||||
}
|
||||
#[inline]
|
||||
pub fn finish_ndb_event_meta_buffer<'a, 'b>(
|
||||
fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
|
||||
root: flatbuffers::WIPOffset<NdbEventMeta<'a>>) {
|
||||
fbb.finish(root, None);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn finish_size_prefixed_ndb_event_meta_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<NdbEventMeta<'a>>) {
|
||||
fbb.finish_size_prefixed(root, None);
|
||||
}
|
||||
514
nostrdb/bindings/rust/ndb_profile.rs
Normal file
514
nostrdb/bindings/rust/ndb_profile.rs
Normal file
@@ -0,0 +1,514 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
|
||||
// @generated
|
||||
|
||||
use core::mem;
|
||||
use core::cmp::Ordering;
|
||||
|
||||
extern crate flatbuffers;
|
||||
use self::flatbuffers::{EndianScalar, Follow};
|
||||
|
||||
pub enum NdbProfileOffset {}
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
|
||||
pub struct NdbProfile<'a> {
|
||||
pub _tab: flatbuffers::Table<'a>,
|
||||
}
|
||||
|
||||
impl<'a> flatbuffers::Follow<'a> for NdbProfile<'a> {
|
||||
type Inner = NdbProfile<'a>;
|
||||
#[inline]
|
||||
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
||||
Self { _tab: flatbuffers::Table::new(buf, loc) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> NdbProfile<'a> {
|
||||
pub const VT_NAME: flatbuffers::VOffsetT = 4;
|
||||
pub const VT_WEBSITE: flatbuffers::VOffsetT = 6;
|
||||
pub const VT_ABOUT: flatbuffers::VOffsetT = 8;
|
||||
pub const VT_LUD16: flatbuffers::VOffsetT = 10;
|
||||
pub const VT_BANNER: flatbuffers::VOffsetT = 12;
|
||||
pub const VT_DISPLAY_NAME: flatbuffers::VOffsetT = 14;
|
||||
pub const VT_REACTIONS: flatbuffers::VOffsetT = 16;
|
||||
pub const VT_PICTURE: flatbuffers::VOffsetT = 18;
|
||||
pub const VT_NIP05: flatbuffers::VOffsetT = 20;
|
||||
pub const VT_DAMUS_DONATION: flatbuffers::VOffsetT = 22;
|
||||
pub const VT_DAMUS_DONATION_V2: flatbuffers::VOffsetT = 24;
|
||||
pub const VT_LUD06: flatbuffers::VOffsetT = 26;
|
||||
|
||||
#[inline]
|
||||
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
|
||||
NdbProfile { _tab: table }
|
||||
}
|
||||
#[allow(unused_mut)]
|
||||
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
|
||||
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
|
||||
args: &'args NdbProfileArgs<'args>
|
||||
) -> flatbuffers::WIPOffset<NdbProfile<'bldr>> {
|
||||
let mut builder = NdbProfileBuilder::new(_fbb);
|
||||
if let Some(x) = args.lud06 { builder.add_lud06(x); }
|
||||
builder.add_damus_donation_v2(args.damus_donation_v2);
|
||||
builder.add_damus_donation(args.damus_donation);
|
||||
if let Some(x) = args.nip05 { builder.add_nip05(x); }
|
||||
if let Some(x) = args.picture { builder.add_picture(x); }
|
||||
if let Some(x) = args.display_name { builder.add_display_name(x); }
|
||||
if let Some(x) = args.banner { builder.add_banner(x); }
|
||||
if let Some(x) = args.lud16 { builder.add_lud16(x); }
|
||||
if let Some(x) = args.about { builder.add_about(x); }
|
||||
if let Some(x) = args.website { builder.add_website(x); }
|
||||
if let Some(x) = args.name { builder.add_name(x); }
|
||||
builder.add_reactions(args.reactions);
|
||||
builder.finish()
|
||||
}
|
||||
|
||||
|
||||
#[inline]
|
||||
pub fn name(&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>>(NdbProfile::VT_NAME, None)}
|
||||
}
|
||||
#[inline]
|
||||
pub fn website(&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>>(NdbProfile::VT_WEBSITE, None)}
|
||||
}
|
||||
#[inline]
|
||||
pub fn about(&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>>(NdbProfile::VT_ABOUT, None)}
|
||||
}
|
||||
#[inline]
|
||||
pub fn lud16(&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>>(NdbProfile::VT_LUD16, None)}
|
||||
}
|
||||
#[inline]
|
||||
pub fn banner(&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>>(NdbProfile::VT_BANNER, None)}
|
||||
}
|
||||
#[inline]
|
||||
pub fn display_name(&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>>(NdbProfile::VT_DISPLAY_NAME, None)}
|
||||
}
|
||||
#[inline]
|
||||
pub fn reactions(&self) -> bool {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<bool>(NdbProfile::VT_REACTIONS, Some(true)).unwrap()}
|
||||
}
|
||||
#[inline]
|
||||
pub fn picture(&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>>(NdbProfile::VT_PICTURE, None)}
|
||||
}
|
||||
#[inline]
|
||||
pub fn nip05(&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>>(NdbProfile::VT_NIP05, None)}
|
||||
}
|
||||
#[inline]
|
||||
pub fn damus_donation(&self) -> i32 {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<i32>(NdbProfile::VT_DAMUS_DONATION, Some(0)).unwrap()}
|
||||
}
|
||||
#[inline]
|
||||
pub fn damus_donation_v2(&self) -> i32 {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<i32>(NdbProfile::VT_DAMUS_DONATION_V2, Some(0)).unwrap()}
|
||||
}
|
||||
#[inline]
|
||||
pub fn lud06(&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>>(NdbProfile::VT_LUD06, None)}
|
||||
}
|
||||
}
|
||||
|
||||
impl flatbuffers::Verifiable for NdbProfile<'_> {
|
||||
#[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>>("name", Self::VT_NAME, false)?
|
||||
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("website", Self::VT_WEBSITE, false)?
|
||||
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("about", Self::VT_ABOUT, false)?
|
||||
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("lud16", Self::VT_LUD16, false)?
|
||||
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("banner", Self::VT_BANNER, false)?
|
||||
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("display_name", Self::VT_DISPLAY_NAME, false)?
|
||||
.visit_field::<bool>("reactions", Self::VT_REACTIONS, false)?
|
||||
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("picture", Self::VT_PICTURE, false)?
|
||||
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("nip05", Self::VT_NIP05, false)?
|
||||
.visit_field::<i32>("damus_donation", Self::VT_DAMUS_DONATION, false)?
|
||||
.visit_field::<i32>("damus_donation_v2", Self::VT_DAMUS_DONATION_V2, false)?
|
||||
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("lud06", Self::VT_LUD06, false)?
|
||||
.finish();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
pub struct NdbProfileArgs<'a> {
|
||||
pub name: Option<flatbuffers::WIPOffset<&'a str>>,
|
||||
pub website: Option<flatbuffers::WIPOffset<&'a str>>,
|
||||
pub about: Option<flatbuffers::WIPOffset<&'a str>>,
|
||||
pub lud16: Option<flatbuffers::WIPOffset<&'a str>>,
|
||||
pub banner: Option<flatbuffers::WIPOffset<&'a str>>,
|
||||
pub display_name: Option<flatbuffers::WIPOffset<&'a str>>,
|
||||
pub reactions: bool,
|
||||
pub picture: Option<flatbuffers::WIPOffset<&'a str>>,
|
||||
pub nip05: Option<flatbuffers::WIPOffset<&'a str>>,
|
||||
pub damus_donation: i32,
|
||||
pub damus_donation_v2: i32,
|
||||
pub lud06: Option<flatbuffers::WIPOffset<&'a str>>,
|
||||
}
|
||||
impl<'a> Default for NdbProfileArgs<'a> {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
NdbProfileArgs {
|
||||
name: None,
|
||||
website: None,
|
||||
about: None,
|
||||
lud16: None,
|
||||
banner: None,
|
||||
display_name: None,
|
||||
reactions: true,
|
||||
picture: None,
|
||||
nip05: None,
|
||||
damus_donation: 0,
|
||||
damus_donation_v2: 0,
|
||||
lud06: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct NdbProfileBuilder<'a: 'b, 'b> {
|
||||
fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
|
||||
start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
|
||||
}
|
||||
impl<'a: 'b, 'b> NdbProfileBuilder<'a, 'b> {
|
||||
#[inline]
|
||||
pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
|
||||
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(NdbProfile::VT_NAME, name);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_website(&mut self, website: flatbuffers::WIPOffset<&'b str>) {
|
||||
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(NdbProfile::VT_WEBSITE, website);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_about(&mut self, about: flatbuffers::WIPOffset<&'b str>) {
|
||||
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(NdbProfile::VT_ABOUT, about);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_lud16(&mut self, lud16: flatbuffers::WIPOffset<&'b str>) {
|
||||
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(NdbProfile::VT_LUD16, lud16);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_banner(&mut self, banner: flatbuffers::WIPOffset<&'b str>) {
|
||||
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(NdbProfile::VT_BANNER, banner);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_display_name(&mut self, display_name: flatbuffers::WIPOffset<&'b str>) {
|
||||
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(NdbProfile::VT_DISPLAY_NAME, display_name);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_reactions(&mut self, reactions: bool) {
|
||||
self.fbb_.push_slot::<bool>(NdbProfile::VT_REACTIONS, reactions, true);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_picture(&mut self, picture: flatbuffers::WIPOffset<&'b str>) {
|
||||
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(NdbProfile::VT_PICTURE, picture);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_nip05(&mut self, nip05: flatbuffers::WIPOffset<&'b str>) {
|
||||
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(NdbProfile::VT_NIP05, nip05);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_damus_donation(&mut self, damus_donation: i32) {
|
||||
self.fbb_.push_slot::<i32>(NdbProfile::VT_DAMUS_DONATION, damus_donation, 0);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_damus_donation_v2(&mut self, damus_donation_v2: i32) {
|
||||
self.fbb_.push_slot::<i32>(NdbProfile::VT_DAMUS_DONATION_V2, damus_donation_v2, 0);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_lud06(&mut self, lud06: flatbuffers::WIPOffset<&'b str>) {
|
||||
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(NdbProfile::VT_LUD06, lud06);
|
||||
}
|
||||
#[inline]
|
||||
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> NdbProfileBuilder<'a, 'b> {
|
||||
let start = _fbb.start_table();
|
||||
NdbProfileBuilder {
|
||||
fbb_: _fbb,
|
||||
start_: start,
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn finish(self) -> flatbuffers::WIPOffset<NdbProfile<'a>> {
|
||||
let o = self.fbb_.end_table(self.start_);
|
||||
flatbuffers::WIPOffset::new(o.value())
|
||||
}
|
||||
}
|
||||
|
||||
impl core::fmt::Debug for NdbProfile<'_> {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
let mut ds = f.debug_struct("NdbProfile");
|
||||
ds.field("name", &self.name());
|
||||
ds.field("website", &self.website());
|
||||
ds.field("about", &self.about());
|
||||
ds.field("lud16", &self.lud16());
|
||||
ds.field("banner", &self.banner());
|
||||
ds.field("display_name", &self.display_name());
|
||||
ds.field("reactions", &self.reactions());
|
||||
ds.field("picture", &self.picture());
|
||||
ds.field("nip05", &self.nip05());
|
||||
ds.field("damus_donation", &self.damus_donation());
|
||||
ds.field("damus_donation_v2", &self.damus_donation_v2());
|
||||
ds.field("lud06", &self.lud06());
|
||||
ds.finish()
|
||||
}
|
||||
}
|
||||
pub enum NdbProfileRecordOffset {}
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
|
||||
pub struct NdbProfileRecord<'a> {
|
||||
pub _tab: flatbuffers::Table<'a>,
|
||||
}
|
||||
|
||||
impl<'a> flatbuffers::Follow<'a> for NdbProfileRecord<'a> {
|
||||
type Inner = NdbProfileRecord<'a>;
|
||||
#[inline]
|
||||
unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
|
||||
Self { _tab: flatbuffers::Table::new(buf, loc) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> NdbProfileRecord<'a> {
|
||||
pub const VT_PROFILE: flatbuffers::VOffsetT = 4;
|
||||
pub const VT_RECEIVED_AT: flatbuffers::VOffsetT = 6;
|
||||
pub const VT_NOTE_KEY: flatbuffers::VOffsetT = 8;
|
||||
pub const VT_LNURL: flatbuffers::VOffsetT = 10;
|
||||
|
||||
#[inline]
|
||||
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
|
||||
NdbProfileRecord { _tab: table }
|
||||
}
|
||||
#[allow(unused_mut)]
|
||||
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
|
||||
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
|
||||
args: &'args NdbProfileRecordArgs<'args>
|
||||
) -> flatbuffers::WIPOffset<NdbProfileRecord<'bldr>> {
|
||||
let mut builder = NdbProfileRecordBuilder::new(_fbb);
|
||||
builder.add_note_key(args.note_key);
|
||||
builder.add_received_at(args.received_at);
|
||||
if let Some(x) = args.lnurl { builder.add_lnurl(x); }
|
||||
if let Some(x) = args.profile { builder.add_profile(x); }
|
||||
builder.finish()
|
||||
}
|
||||
|
||||
|
||||
#[inline]
|
||||
pub fn profile(&self) -> Option<NdbProfile<'a>> {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<NdbProfile>>(NdbProfileRecord::VT_PROFILE, None)}
|
||||
}
|
||||
#[inline]
|
||||
pub fn received_at(&self) -> u64 {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<u64>(NdbProfileRecord::VT_RECEIVED_AT, Some(0)).unwrap()}
|
||||
}
|
||||
#[inline]
|
||||
pub fn note_key(&self) -> u64 {
|
||||
// Safety:
|
||||
// Created from valid Table for this object
|
||||
// which contains a valid value in this slot
|
||||
unsafe { self._tab.get::<u64>(NdbProfileRecord::VT_NOTE_KEY, Some(0)).unwrap()}
|
||||
}
|
||||
#[inline]
|
||||
pub fn lnurl(&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>>(NdbProfileRecord::VT_LNURL, None)}
|
||||
}
|
||||
}
|
||||
|
||||
impl flatbuffers::Verifiable for NdbProfileRecord<'_> {
|
||||
#[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<NdbProfile>>("profile", Self::VT_PROFILE, false)?
|
||||
.visit_field::<u64>("received_at", Self::VT_RECEIVED_AT, false)?
|
||||
.visit_field::<u64>("note_key", Self::VT_NOTE_KEY, false)?
|
||||
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("lnurl", Self::VT_LNURL, false)?
|
||||
.finish();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
pub struct NdbProfileRecordArgs<'a> {
|
||||
pub profile: Option<flatbuffers::WIPOffset<NdbProfile<'a>>>,
|
||||
pub received_at: u64,
|
||||
pub note_key: u64,
|
||||
pub lnurl: Option<flatbuffers::WIPOffset<&'a str>>,
|
||||
}
|
||||
impl<'a> Default for NdbProfileRecordArgs<'a> {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
NdbProfileRecordArgs {
|
||||
profile: None,
|
||||
received_at: 0,
|
||||
note_key: 0,
|
||||
lnurl: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct NdbProfileRecordBuilder<'a: 'b, 'b> {
|
||||
fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
|
||||
start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
|
||||
}
|
||||
impl<'a: 'b, 'b> NdbProfileRecordBuilder<'a, 'b> {
|
||||
#[inline]
|
||||
pub fn add_profile(&mut self, profile: flatbuffers::WIPOffset<NdbProfile<'b >>) {
|
||||
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<NdbProfile>>(NdbProfileRecord::VT_PROFILE, profile);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_received_at(&mut self, received_at: u64) {
|
||||
self.fbb_.push_slot::<u64>(NdbProfileRecord::VT_RECEIVED_AT, received_at, 0);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_note_key(&mut self, note_key: u64) {
|
||||
self.fbb_.push_slot::<u64>(NdbProfileRecord::VT_NOTE_KEY, note_key, 0);
|
||||
}
|
||||
#[inline]
|
||||
pub fn add_lnurl(&mut self, lnurl: flatbuffers::WIPOffset<&'b str>) {
|
||||
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(NdbProfileRecord::VT_LNURL, lnurl);
|
||||
}
|
||||
#[inline]
|
||||
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> NdbProfileRecordBuilder<'a, 'b> {
|
||||
let start = _fbb.start_table();
|
||||
NdbProfileRecordBuilder {
|
||||
fbb_: _fbb,
|
||||
start_: start,
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn finish(self) -> flatbuffers::WIPOffset<NdbProfileRecord<'a>> {
|
||||
let o = self.fbb_.end_table(self.start_);
|
||||
flatbuffers::WIPOffset::new(o.value())
|
||||
}
|
||||
}
|
||||
|
||||
impl core::fmt::Debug for NdbProfileRecord<'_> {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
let mut ds = f.debug_struct("NdbProfileRecord");
|
||||
ds.field("profile", &self.profile());
|
||||
ds.field("received_at", &self.received_at());
|
||||
ds.field("note_key", &self.note_key());
|
||||
ds.field("lnurl", &self.lnurl());
|
||||
ds.finish()
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
/// Verifies that a buffer of bytes contains a `NdbProfileRecord`
|
||||
/// 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_ndb_profile_record_unchecked`.
|
||||
pub fn root_as_ndb_profile_record(buf: &[u8]) -> Result<NdbProfileRecord, flatbuffers::InvalidFlatbuffer> {
|
||||
flatbuffers::root::<NdbProfileRecord>(buf)
|
||||
}
|
||||
#[inline]
|
||||
/// Verifies that a buffer of bytes contains a size prefixed
|
||||
/// `NdbProfileRecord` 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_ndb_profile_record_unchecked`.
|
||||
pub fn size_prefixed_root_as_ndb_profile_record(buf: &[u8]) -> Result<NdbProfileRecord, flatbuffers::InvalidFlatbuffer> {
|
||||
flatbuffers::size_prefixed_root::<NdbProfileRecord>(buf)
|
||||
}
|
||||
#[inline]
|
||||
/// Verifies, with the given options, that a buffer of bytes
|
||||
/// contains a `NdbProfileRecord` 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_ndb_profile_record_unchecked`.
|
||||
pub fn root_as_ndb_profile_record_with_opts<'b, 'o>(
|
||||
opts: &'o flatbuffers::VerifierOptions,
|
||||
buf: &'b [u8],
|
||||
) -> Result<NdbProfileRecord<'b>, flatbuffers::InvalidFlatbuffer> {
|
||||
flatbuffers::root_with_opts::<NdbProfileRecord<'b>>(opts, buf)
|
||||
}
|
||||
#[inline]
|
||||
/// Verifies, with the given verifier options, that a buffer of
|
||||
/// bytes contains a size prefixed `NdbProfileRecord` 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_ndb_profile_record_unchecked`.
|
||||
pub fn size_prefixed_root_as_ndb_profile_record_with_opts<'b, 'o>(
|
||||
opts: &'o flatbuffers::VerifierOptions,
|
||||
buf: &'b [u8],
|
||||
) -> Result<NdbProfileRecord<'b>, flatbuffers::InvalidFlatbuffer> {
|
||||
flatbuffers::size_prefixed_root_with_opts::<NdbProfileRecord<'b>>(opts, buf)
|
||||
}
|
||||
#[inline]
|
||||
/// Assumes, without verification, that a buffer of bytes contains a NdbProfileRecord and returns it.
|
||||
/// # Safety
|
||||
/// Callers must trust the given bytes do indeed contain a valid `NdbProfileRecord`.
|
||||
pub unsafe fn root_as_ndb_profile_record_unchecked(buf: &[u8]) -> NdbProfileRecord {
|
||||
flatbuffers::root_unchecked::<NdbProfileRecord>(buf)
|
||||
}
|
||||
#[inline]
|
||||
/// Assumes, without verification, that a buffer of bytes contains a size prefixed NdbProfileRecord and returns it.
|
||||
/// # Safety
|
||||
/// Callers must trust the given bytes do indeed contain a valid size prefixed `NdbProfileRecord`.
|
||||
pub unsafe fn size_prefixed_root_as_ndb_profile_record_unchecked(buf: &[u8]) -> NdbProfileRecord {
|
||||
flatbuffers::size_prefixed_root_unchecked::<NdbProfileRecord>(buf)
|
||||
}
|
||||
#[inline]
|
||||
pub fn finish_ndb_profile_record_buffer<'a, 'b>(
|
||||
fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
|
||||
root: flatbuffers::WIPOffset<NdbProfileRecord<'a>>) {
|
||||
fbb.finish(root, None);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn finish_size_prefixed_ndb_profile_record_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<NdbProfileRecord<'a>>) {
|
||||
fbb.finish_size_prefixed(root, None);
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
// swiftlint:disable all
|
||||
// swiftformat:disable all
|
||||
|
||||
|
||||
import FlatBuffers
|
||||
|
||||
public struct NdbProfile: FlatBufferObject, Verifiable {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user