由于我不知道如何获取PlasmaContainsRequest
对象来构造WIPOffset
对象,因此如何构造PlasmaContainsRequestArgs
对象?
我使用flatc
1.10.0生成了这个Rust代码:
impl<'a> PlasmaContainsRequest<'a> {
#[inline]
pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
PlasmaContainsRequest { _tab: table }
}
#[allow(unused_mut)]
pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
_fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
args: &'args PlasmaContainsRequestArgs<'args>,
) -> flatbuffers::WIPOffset<PlasmaContainsRequest<'bldr>> {
let mut builder = PlasmaContainsRequestBuilder::new(_fbb);
if let Some(x) = args.object_id {
builder.add_object_id(x);
}
builder.finish()
}
pub const VT_OBJECT_ID: flatbuffers::VOffsetT = 4;
#[inline]
pub fn object_id(&self) -> Option<&'a str> {
self._tab
.get::<flatbuffers::ForwardsUOffset<&str>>(PlasmaContainsRequest::VT_OBJECT_ID, None)
}
}
pub struct PlasmaContainsRequestArgs<'a> {
pub object_id: Option<flatbuffers::WIPOffset<&'a str>>,
}
impl<'a> Default for PlasmaContainsRequestArgs<'a> {
#[inline]
fn default() -> Self {
PlasmaContainsRequestArgs { object_id: None }
}
}