#![allow(bare_trait_objects)]
#![allow(
non_camel_case_types,
non_snake_case,
non_upper_case_globals,
clippy::all
)]
pub use self::errors::*;
pub use self::types::*;
pub mod types;
pub mod services {
pub mod graph_service {
#[derive(Clone, Debug)]
pub enum AuthenticateExn {
#[doc(hidden)]
Success(crate::fbthrift_protocol::graph::types::AuthResponse),
ApplicationException(crate::fbthrift::ApplicationException),
}
impl
::std::convert::From<
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
> for AuthenticateExn
{
fn from(
err: crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
) -> Self {
match err {
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError::ApplicationException(aexn) => {
AuthenticateExn::ApplicationException(aexn)
}
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError::ThriftError(err) => {
AuthenticateExn::ApplicationException(
crate::fbthrift::ApplicationException {
message: err.to_string(),
type_:
crate::fbthrift::ApplicationExceptionErrorCode::InternalError,
},
)
}
}
}
}
impl ::std::convert::From<crate::fbthrift::ApplicationException> for AuthenticateExn {
fn from(exn: crate::fbthrift::ApplicationException) -> Self {
Self::ApplicationException(exn)
}
}
impl crate::fbthrift::ExceptionInfo for AuthenticateExn {
fn exn_name(&self) -> &'static str {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl crate::fbthrift::ResultInfo for AuthenticateExn {
fn result_type(&self) -> crate::fbthrift::ResultType {
match self {
Self::Success(_) => crate::fbthrift::ResultType::Return,
Self::ApplicationException(_aexn) => crate::fbthrift::ResultType::Exception,
}
}
}
impl crate::fbthrift::GetTType for AuthenticateExn {
const TTYPE: crate::fbthrift::TType = crate::fbthrift::TType::Struct;
}
impl<P> crate::fbthrift::Serialize<P> for AuthenticateExn
where
P: crate::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
if let Self::ApplicationException(aexn) = self {
return aexn.write(p);
}
p.write_struct_begin("Authenticate");
match self {
Self::Success(inner) => {
p.write_field_begin("Success", crate::fbthrift::TType::Struct, 0i16);
inner.write(p);
p.write_field_end();
}
Self::ApplicationException(_aexn) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
impl<P> crate::fbthrift::Deserialize<P> for AuthenticateExn
where
P: crate::fbthrift::ProtocolReader,
{
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static RETURNS: &[crate::fbthrift::Field] = &[crate::fbthrift::Field::new(
"Success",
crate::fbthrift::TType::Struct,
0,
)];
let _ = p.read_struct_begin(|_| ())?;
let mut once = false;
let mut alt = ::std::option::Option::None;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
match ((fty, fid as ::std::primitive::i32), once) {
((crate::fbthrift::TType::Stop, _), _) => {
p.read_field_end()?;
break;
}
((crate::fbthrift::TType::Struct, 0i32), false) => {
once = true;
alt = ::std::option::Option::Some(Self::Success(
crate::fbthrift::Deserialize::read(p)?,
));
}
((ty, _id), false) => p.skip(ty)?,
((badty, badid), true) => {
return ::std::result::Result::Err(::std::convert::From::from(
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
format!(
"unwanted extra union {} field ty {:?} id {}",
"AuthenticateExn", badty, badid,
),
),
))
}
}
p.read_field_end()?;
}
p.read_struct_end()?;
alt.ok_or_else(|| {
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::MissingResult,
format!("Empty union {}", "AuthenticateExn"),
)
.into()
})
}
}
#[derive(Clone, Debug)]
pub enum SignoutExn {
#[doc(hidden)]
Success(()),
ApplicationException(crate::fbthrift::ApplicationException),
}
impl
::std::convert::From<
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
> for SignoutExn
{
fn from(
err: crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
) -> Self {
match err {
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError::ApplicationException(aexn) => {
SignoutExn::ApplicationException(aexn)
}
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError::ThriftError(err) => {
SignoutExn::ApplicationException(crate::fbthrift::ApplicationException {
message: err.to_string(),
type_: crate::fbthrift::ApplicationExceptionErrorCode::InternalError,
})
}
}
}
}
impl ::std::convert::From<crate::fbthrift::ApplicationException> for SignoutExn {
fn from(exn: crate::fbthrift::ApplicationException) -> Self {
Self::ApplicationException(exn)
}
}
impl crate::fbthrift::ExceptionInfo for SignoutExn {
fn exn_name(&self) -> &'static str {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl crate::fbthrift::ResultInfo for SignoutExn {
fn result_type(&self) -> crate::fbthrift::ResultType {
match self {
Self::Success(_) => crate::fbthrift::ResultType::Return,
Self::ApplicationException(_aexn) => crate::fbthrift::ResultType::Exception,
}
}
}
impl crate::fbthrift::GetTType for SignoutExn {
const TTYPE: crate::fbthrift::TType = crate::fbthrift::TType::Struct;
}
impl<P> crate::fbthrift::Serialize<P> for SignoutExn
where
P: crate::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
if let Self::ApplicationException(aexn) = self {
return aexn.write(p);
}
p.write_struct_begin("Signout");
match self {
Self::Success(inner) => {
p.write_field_begin("Success", crate::fbthrift::TType::Void, 0i16);
inner.write(p);
p.write_field_end();
}
Self::ApplicationException(_aexn) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
impl<P> crate::fbthrift::Deserialize<P> for SignoutExn
where
P: crate::fbthrift::ProtocolReader,
{
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static RETURNS: &[crate::fbthrift::Field] = &[crate::fbthrift::Field::new(
"Success",
crate::fbthrift::TType::Void,
0,
)];
let _ = p.read_struct_begin(|_| ())?;
let mut once = false;
let mut alt = Self::Success(());
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
match ((fty, fid as ::std::primitive::i32), once) {
((crate::fbthrift::TType::Stop, _), _) => {
p.read_field_end()?;
break;
}
((crate::fbthrift::TType::Void, 0i32), false) => {
once = true;
alt = Self::Success(crate::fbthrift::Deserialize::read(p)?);
}
((ty, _id), false) => p.skip(ty)?,
((badty, badid), true) => {
return ::std::result::Result::Err(::std::convert::From::from(
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
format!(
"unwanted extra union {} field ty {:?} id {}",
"SignoutExn", badty, badid,
),
),
))
}
}
p.read_field_end()?;
}
p.read_struct_end()?;
::std::result::Result::Ok(alt)
}
}
#[derive(Clone, Debug)]
pub enum ExecuteExn {
#[doc(hidden)]
Success(crate::fbthrift_protocol::graph::types::ExecutionResponse),
ApplicationException(crate::fbthrift::ApplicationException),
}
impl
::std::convert::From<
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
> for ExecuteExn
{
fn from(
err: crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
) -> Self {
match err {
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError::ApplicationException(aexn) => {
ExecuteExn::ApplicationException(aexn)
}
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError::ThriftError(err) => {
ExecuteExn::ApplicationException(crate::fbthrift::ApplicationException {
message: err.to_string(),
type_: crate::fbthrift::ApplicationExceptionErrorCode::InternalError,
})
}
}
}
}
impl ::std::convert::From<crate::fbthrift::ApplicationException> for ExecuteExn {
fn from(exn: crate::fbthrift::ApplicationException) -> Self {
Self::ApplicationException(exn)
}
}
impl crate::fbthrift::ExceptionInfo for ExecuteExn {
fn exn_name(&self) -> &'static str {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl crate::fbthrift::ResultInfo for ExecuteExn {
fn result_type(&self) -> crate::fbthrift::ResultType {
match self {
Self::Success(_) => crate::fbthrift::ResultType::Return,
Self::ApplicationException(_aexn) => crate::fbthrift::ResultType::Exception,
}
}
}
impl crate::fbthrift::GetTType for ExecuteExn {
const TTYPE: crate::fbthrift::TType = crate::fbthrift::TType::Struct;
}
impl<P> crate::fbthrift::Serialize<P> for ExecuteExn
where
P: crate::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
if let Self::ApplicationException(aexn) = self {
return aexn.write(p);
}
p.write_struct_begin("Execute");
match self {
Self::Success(inner) => {
p.write_field_begin("Success", crate::fbthrift::TType::Struct, 0i16);
inner.write(p);
p.write_field_end();
}
Self::ApplicationException(_aexn) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
impl<P> crate::fbthrift::Deserialize<P> for ExecuteExn
where
P: crate::fbthrift::ProtocolReader,
{
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static RETURNS: &[crate::fbthrift::Field] = &[crate::fbthrift::Field::new(
"Success",
crate::fbthrift::TType::Struct,
0,
)];
let _ = p.read_struct_begin(|_| ())?;
let mut once = false;
let mut alt = ::std::option::Option::None;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
match ((fty, fid as ::std::primitive::i32), once) {
((crate::fbthrift::TType::Stop, _), _) => {
p.read_field_end()?;
break;
}
((crate::fbthrift::TType::Struct, 0i32), false) => {
once = true;
alt = ::std::option::Option::Some(Self::Success(
crate::fbthrift::Deserialize::read(p)?,
));
}
((ty, _id), false) => p.skip(ty)?,
((badty, badid), true) => {
return ::std::result::Result::Err(::std::convert::From::from(
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
format!(
"unwanted extra union {} field ty {:?} id {}",
"ExecuteExn", badty, badid,
),
),
))
}
}
p.read_field_end()?;
}
p.read_struct_end()?;
alt.ok_or_else(|| {
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::MissingResult,
format!("Empty union {}", "ExecuteExn"),
)
.into()
})
}
}
#[derive(Clone, Debug)]
pub enum ExecuteWithParameterExn {
#[doc(hidden)]
Success(crate::fbthrift_protocol::graph::types::ExecutionResponse),
ApplicationException(crate::fbthrift::ApplicationException),
}
impl
::std::convert::From<
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
> for ExecuteWithParameterExn
{
fn from(
err: crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
) -> Self {
match err {
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError::ApplicationException(
aexn,
) => ExecuteWithParameterExn::ApplicationException(aexn),
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError::ThriftError(err) => {
ExecuteWithParameterExn::ApplicationException(
crate::fbthrift::ApplicationException {
message: err.to_string(),
type_:
crate::fbthrift::ApplicationExceptionErrorCode::InternalError,
},
)
}
}
}
}
impl ::std::convert::From<crate::fbthrift::ApplicationException> for ExecuteWithParameterExn {
fn from(exn: crate::fbthrift::ApplicationException) -> Self {
Self::ApplicationException(exn)
}
}
impl crate::fbthrift::ExceptionInfo for ExecuteWithParameterExn {
fn exn_name(&self) -> &'static str {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl crate::fbthrift::ResultInfo for ExecuteWithParameterExn {
fn result_type(&self) -> crate::fbthrift::ResultType {
match self {
Self::Success(_) => crate::fbthrift::ResultType::Return,
Self::ApplicationException(_aexn) => crate::fbthrift::ResultType::Exception,
}
}
}
impl crate::fbthrift::GetTType for ExecuteWithParameterExn {
const TTYPE: crate::fbthrift::TType = crate::fbthrift::TType::Struct;
}
impl<P> crate::fbthrift::Serialize<P> for ExecuteWithParameterExn
where
P: crate::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
if let Self::ApplicationException(aexn) = self {
return aexn.write(p);
}
p.write_struct_begin("ExecuteWithParameter");
match self {
Self::Success(inner) => {
p.write_field_begin("Success", crate::fbthrift::TType::Struct, 0i16);
inner.write(p);
p.write_field_end();
}
Self::ApplicationException(_aexn) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
impl<P> crate::fbthrift::Deserialize<P> for ExecuteWithParameterExn
where
P: crate::fbthrift::ProtocolReader,
{
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static RETURNS: &[crate::fbthrift::Field] = &[crate::fbthrift::Field::new(
"Success",
crate::fbthrift::TType::Struct,
0,
)];
let _ = p.read_struct_begin(|_| ())?;
let mut once = false;
let mut alt = ::std::option::Option::None;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
match ((fty, fid as ::std::primitive::i32), once) {
((crate::fbthrift::TType::Stop, _), _) => {
p.read_field_end()?;
break;
}
((crate::fbthrift::TType::Struct, 0i32), false) => {
once = true;
alt = ::std::option::Option::Some(Self::Success(
crate::fbthrift::Deserialize::read(p)?,
));
}
((ty, _id), false) => p.skip(ty)?,
((badty, badid), true) => {
return ::std::result::Result::Err(::std::convert::From::from(
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
format!(
"unwanted extra union {} field ty {:?} id {}",
"ExecuteWithParameterExn", badty, badid,
),
),
))
}
}
p.read_field_end()?;
}
p.read_struct_end()?;
alt.ok_or_else(|| {
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::MissingResult,
format!("Empty union {}", "ExecuteWithParameterExn"),
)
.into()
})
}
}
#[derive(Clone, Debug)]
pub enum ExecuteJsonExn {
#[doc(hidden)]
Success(::std::vec::Vec<::std::primitive::u8>),
ApplicationException(crate::fbthrift::ApplicationException),
}
impl
::std::convert::From<
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
> for ExecuteJsonExn
{
fn from(
err: crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
) -> Self {
match err {
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError::ApplicationException(aexn) => {
ExecuteJsonExn::ApplicationException(aexn)
}
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError::ThriftError(err) => {
ExecuteJsonExn::ApplicationException(
crate::fbthrift::ApplicationException {
message: err.to_string(),
type_:
crate::fbthrift::ApplicationExceptionErrorCode::InternalError,
},
)
}
}
}
}
impl ::std::convert::From<crate::fbthrift::ApplicationException> for ExecuteJsonExn {
fn from(exn: crate::fbthrift::ApplicationException) -> Self {
Self::ApplicationException(exn)
}
}
impl crate::fbthrift::ExceptionInfo for ExecuteJsonExn {
fn exn_name(&self) -> &'static str {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl crate::fbthrift::ResultInfo for ExecuteJsonExn {
fn result_type(&self) -> crate::fbthrift::ResultType {
match self {
Self::Success(_) => crate::fbthrift::ResultType::Return,
Self::ApplicationException(_aexn) => crate::fbthrift::ResultType::Exception,
}
}
}
impl crate::fbthrift::GetTType for ExecuteJsonExn {
const TTYPE: crate::fbthrift::TType = crate::fbthrift::TType::Struct;
}
impl<P> crate::fbthrift::Serialize<P> for ExecuteJsonExn
where
P: crate::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
if let Self::ApplicationException(aexn) = self {
return aexn.write(p);
}
p.write_struct_begin("ExecuteJson");
match self {
Self::Success(inner) => {
p.write_field_begin("Success", crate::fbthrift::TType::String, 0i16);
inner.write(p);
p.write_field_end();
}
Self::ApplicationException(_aexn) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
impl<P> crate::fbthrift::Deserialize<P> for ExecuteJsonExn
where
P: crate::fbthrift::ProtocolReader,
{
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static RETURNS: &[crate::fbthrift::Field] = &[crate::fbthrift::Field::new(
"Success",
crate::fbthrift::TType::String,
0,
)];
let _ = p.read_struct_begin(|_| ())?;
let mut once = false;
let mut alt = ::std::option::Option::None;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
match ((fty, fid as ::std::primitive::i32), once) {
((crate::fbthrift::TType::Stop, _), _) => {
p.read_field_end()?;
break;
}
((crate::fbthrift::TType::String, 0i32), false) => {
once = true;
alt = ::std::option::Option::Some(Self::Success(
crate::fbthrift::Deserialize::read(p)?,
));
}
((ty, _id), false) => p.skip(ty)?,
((badty, badid), true) => {
return ::std::result::Result::Err(::std::convert::From::from(
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
format!(
"unwanted extra union {} field ty {:?} id {}",
"ExecuteJsonExn", badty, badid,
),
),
))
}
}
p.read_field_end()?;
}
p.read_struct_end()?;
alt.ok_or_else(|| {
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::MissingResult,
format!("Empty union {}", "ExecuteJsonExn"),
)
.into()
})
}
}
#[derive(Clone, Debug)]
pub enum ExecuteJsonWithParameterExn {
#[doc(hidden)]
Success(::std::vec::Vec<::std::primitive::u8>),
ApplicationException(crate::fbthrift::ApplicationException),
}
impl ::std::convert::From<crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError>
for ExecuteJsonWithParameterExn
{
fn from(err: crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError) -> Self {
match err {
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError::ApplicationException(
aexn,
) => ExecuteJsonWithParameterExn::ApplicationException(aexn),
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError::ThriftError(err) => {
ExecuteJsonWithParameterExn::ApplicationException(
crate::fbthrift::ApplicationException {
message: err.to_string(),
type_:
crate::fbthrift::ApplicationExceptionErrorCode::InternalError,
},
)
}
}
}
}
impl ::std::convert::From<crate::fbthrift::ApplicationException> for ExecuteJsonWithParameterExn {
fn from(exn: crate::fbthrift::ApplicationException) -> Self {
Self::ApplicationException(exn)
}
}
impl crate::fbthrift::ExceptionInfo for ExecuteJsonWithParameterExn {
fn exn_name(&self) -> &'static str {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl crate::fbthrift::ResultInfo for ExecuteJsonWithParameterExn {
fn result_type(&self) -> crate::fbthrift::ResultType {
match self {
Self::Success(_) => crate::fbthrift::ResultType::Return,
Self::ApplicationException(_aexn) => crate::fbthrift::ResultType::Exception,
}
}
}
impl crate::fbthrift::GetTType for ExecuteJsonWithParameterExn {
const TTYPE: crate::fbthrift::TType = crate::fbthrift::TType::Struct;
}
impl<P> crate::fbthrift::Serialize<P> for ExecuteJsonWithParameterExn
where
P: crate::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
if let Self::ApplicationException(aexn) = self {
return aexn.write(p);
}
p.write_struct_begin("ExecuteJsonWithParameter");
match self {
Self::Success(inner) => {
p.write_field_begin("Success", crate::fbthrift::TType::String, 0i16);
inner.write(p);
p.write_field_end();
}
Self::ApplicationException(_aexn) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
impl<P> crate::fbthrift::Deserialize<P> for ExecuteJsonWithParameterExn
where
P: crate::fbthrift::ProtocolReader,
{
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static RETURNS: &[crate::fbthrift::Field] = &[crate::fbthrift::Field::new(
"Success",
crate::fbthrift::TType::String,
0,
)];
let _ = p.read_struct_begin(|_| ())?;
let mut once = false;
let mut alt = ::std::option::Option::None;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
match ((fty, fid as ::std::primitive::i32), once) {
((crate::fbthrift::TType::Stop, _), _) => {
p.read_field_end()?;
break;
}
((crate::fbthrift::TType::String, 0i32), false) => {
once = true;
alt = ::std::option::Option::Some(Self::Success(
crate::fbthrift::Deserialize::read(p)?,
));
}
((ty, _id), false) => p.skip(ty)?,
((badty, badid), true) => {
return ::std::result::Result::Err(::std::convert::From::from(
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
format!(
"unwanted extra union {} field ty {:?} id {}",
"ExecuteJsonWithParameterExn", badty, badid,
),
),
))
}
}
p.read_field_end()?;
}
p.read_struct_end()?;
alt.ok_or_else(|| {
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::MissingResult,
format!("Empty union {}", "ExecuteJsonWithParameterExn"),
)
.into()
})
}
}
#[derive(Clone, Debug)]
pub enum VerifyClientVersionExn {
#[doc(hidden)]
Success(crate::fbthrift_protocol::graph::types::VerifyClientVersionResp),
ApplicationException(crate::fbthrift::ApplicationException),
}
impl
::std::convert::From<
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
> for VerifyClientVersionExn
{
fn from(
err: crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
) -> Self {
match err {
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError::ApplicationException(aexn) => {
VerifyClientVersionExn::ApplicationException(aexn)
}
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError::ThriftError(err) => {
VerifyClientVersionExn::ApplicationException(
crate::fbthrift::ApplicationException {
message: err.to_string(),
type_:
crate::fbthrift::ApplicationExceptionErrorCode::InternalError,
},
)
}
}
}
}
impl ::std::convert::From<crate::fbthrift::ApplicationException> for VerifyClientVersionExn {
fn from(exn: crate::fbthrift::ApplicationException) -> Self {
Self::ApplicationException(exn)
}
}
impl crate::fbthrift::ExceptionInfo for VerifyClientVersionExn {
fn exn_name(&self) -> &'static str {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_name called on Success"),
Self::ApplicationException(aexn) => aexn.exn_name(),
}
}
fn exn_value(&self) -> String {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_value called on Success"),
Self::ApplicationException(aexn) => aexn.exn_value(),
}
}
fn exn_is_declared(&self) -> bool {
match self {
Self::Success(_) => panic!("ExceptionInfo::exn_is_declared called on Success"),
Self::ApplicationException(aexn) => aexn.exn_is_declared(),
}
}
}
impl crate::fbthrift::ResultInfo for VerifyClientVersionExn {
fn result_type(&self) -> crate::fbthrift::ResultType {
match self {
Self::Success(_) => crate::fbthrift::ResultType::Return,
Self::ApplicationException(_aexn) => crate::fbthrift::ResultType::Exception,
}
}
}
impl crate::fbthrift::GetTType for VerifyClientVersionExn {
const TTYPE: crate::fbthrift::TType = crate::fbthrift::TType::Struct;
}
impl<P> crate::fbthrift::Serialize<P> for VerifyClientVersionExn
where
P: crate::fbthrift::ProtocolWriter,
{
fn write(&self, p: &mut P) {
if let Self::ApplicationException(aexn) = self {
return aexn.write(p);
}
p.write_struct_begin("VerifyClientVersion");
match self {
Self::Success(inner) => {
p.write_field_begin("Success", crate::fbthrift::TType::Struct, 0i16);
inner.write(p);
p.write_field_end();
}
Self::ApplicationException(_aexn) => unreachable!(),
}
p.write_field_stop();
p.write_struct_end();
}
}
impl<P> crate::fbthrift::Deserialize<P> for VerifyClientVersionExn
where
P: crate::fbthrift::ProtocolReader,
{
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static RETURNS: &[crate::fbthrift::Field] = &[crate::fbthrift::Field::new(
"Success",
crate::fbthrift::TType::Struct,
0,
)];
let _ = p.read_struct_begin(|_| ())?;
let mut once = false;
let mut alt = ::std::option::Option::None;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), RETURNS)?;
match ((fty, fid as ::std::primitive::i32), once) {
((crate::fbthrift::TType::Stop, _), _) => {
p.read_field_end()?;
break;
}
((crate::fbthrift::TType::Struct, 0i32), false) => {
once = true;
alt = ::std::option::Option::Some(Self::Success(
crate::fbthrift::Deserialize::read(p)?,
));
}
((ty, _id), false) => p.skip(ty)?,
((badty, badid), true) => {
return ::std::result::Result::Err(::std::convert::From::from(
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::ProtocolError,
format!(
"unwanted extra union {} field ty {:?} id {}",
"VerifyClientVersionExn", badty, badid,
),
),
))
}
}
p.read_field_end()?;
}
p.read_struct_end()?;
alt.ok_or_else(|| {
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::MissingResult,
format!("Empty union {}", "VerifyClientVersionExn"),
)
.into()
})
}
}
}
}
pub mod client {
use crate::fbthrift_protocol::common;
pub struct GraphServiceImpl<P, T, S = crate::fbthrift::NoopSpawner> {
transport: T,
_phantom: ::std::marker::PhantomData<fn() -> (P, S)>,
}
impl<P, T, S> GraphServiceImpl<P, T, S>
where
P: crate::fbthrift::Protocol,
T: crate::fbthrift::Transport,
P::Frame: crate::fbthrift::Framing<DecBuf = crate::fbthrift::FramingDecoded<T>>,
crate::fbthrift::ProtocolEncoded<P>:
crate::fbthrift::BufMutExt<Final = crate::fbthrift::FramingEncodedFinal<T>>,
P::Deserializer: ::std::marker::Send,
S: crate::fbthrift::help::Spawner,
{
pub fn new(transport: T) -> Self {
Self {
transport,
_phantom: ::std::marker::PhantomData,
}
}
pub fn transport(&self) -> &T {
&self.transport
}
fn _authenticate_impl(
&self,
arg_username: &::std::vec::Vec<::std::primitive::u8>,
arg_password: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
>,
> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
use ::tracing::Instrument as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.authenticate";
}
let args = self::Args_GraphService_authenticate {
username: arg_username,
password: arg_password,
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
let request_env = match crate::fbthrift::help::serialize_request_envelope::<P, _>(
"authenticate",
&args,
) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => {
return ::futures::future::err(err.into()).boxed()
}
};
let call = transport
.call(
SERVICE_NAME.as_cstr(),
METHOD_NAME.as_cstr(),
request_env,
rpc_options,
)
.instrument(::tracing::trace_span!(
"call",
function = "GraphService.authenticate"
));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let (res, _de): (
::std::result::Result<super::services::graph_service::AuthenticateExn, _>,
_,
) = crate::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de)
.await?;
let res = match res {
::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
::std::result::Result::Err(aexn) => ::std::result::Result::Err(
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError::ApplicationException(aexn),
),
};
res
}
.instrument(::tracing::info_span!("GraphService.authenticate"))
.boxed()
}
fn _signout_impl(
&self,
arg_sessionId: ::std::primitive::i64,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
(),
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
>,
> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
use ::tracing::Instrument as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.signout";
}
let args = self::Args_GraphService_signout {
sessionId: arg_sessionId,
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
let request_env =
match crate::fbthrift::help::serialize_request_envelope::<P, _>("signout", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => {
return ::futures::future::err(err.into()).boxed()
}
};
let call = transport
.call(
SERVICE_NAME.as_cstr(),
METHOD_NAME.as_cstr(),
request_env,
rpc_options,
)
.instrument(::tracing::trace_span!(
"call",
function = "GraphService.signout"
));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let (res, _de): (
::std::result::Result<super::services::graph_service::SignoutExn, _>,
_,
) = crate::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de)
.await?;
let res = match res {
::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
::std::result::Result::Err(aexn) => ::std::result::Result::Err(
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError::ApplicationException(aexn),
),
};
res
}
.instrument(::tracing::info_span!("GraphService.signout"))
.boxed()
}
fn _execute_impl(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
>,
> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
use ::tracing::Instrument as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.execute";
}
let args = self::Args_GraphService_execute {
sessionId: arg_sessionId,
stmt: arg_stmt,
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
let request_env =
match crate::fbthrift::help::serialize_request_envelope::<P, _>("execute", &args) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => {
return ::futures::future::err(err.into()).boxed()
}
};
let call = transport
.call(
SERVICE_NAME.as_cstr(),
METHOD_NAME.as_cstr(),
request_env,
rpc_options,
)
.instrument(::tracing::trace_span!(
"call",
function = "GraphService.execute"
));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let (res, _de): (
::std::result::Result<super::services::graph_service::ExecuteExn, _>,
_,
) = crate::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de)
.await?;
let res = match res {
::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
::std::result::Result::Err(aexn) => ::std::result::Result::Err(
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError::ApplicationException(aexn),
),
};
res
}
.instrument(::tracing::info_span!("GraphService.execute"))
.boxed()
}
fn _executeWithParameter_impl(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
>,
> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
use ::tracing::Instrument as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.executeWithParameter";
}
let args = self::Args_GraphService_executeWithParameter {
sessionId: arg_sessionId,
stmt: arg_stmt,
parameterMap: arg_parameterMap,
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
let request_env = match crate::fbthrift::help::serialize_request_envelope::<P, _>(
"executeWithParameter",
&args,
) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => {
return ::futures::future::err(err.into()).boxed()
}
};
let call = transport
.call(
SERVICE_NAME.as_cstr(),
METHOD_NAME.as_cstr(),
request_env,
rpc_options,
)
.instrument(::tracing::trace_span!(
"call",
function = "GraphService.executeWithParameter"
));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let (res, _de): (
::std::result::Result<
super::services::graph_service::ExecuteWithParameterExn,
_,
>,
_,
) = crate::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de)
.await?;
let res = match res {
::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
::std::result::Result::Err(aexn) => ::std::result::Result::Err(
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError::ApplicationException(
aexn,
),
),
};
res
}
.instrument(::tracing::info_span!("GraphService.executeWithParameter"))
.boxed()
}
fn _executeJson_impl(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
>,
> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
use ::tracing::Instrument as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.executeJson";
}
let args = self::Args_GraphService_executeJson {
sessionId: arg_sessionId,
stmt: arg_stmt,
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
let request_env = match crate::fbthrift::help::serialize_request_envelope::<P, _>(
"executeJson",
&args,
) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => {
return ::futures::future::err(err.into()).boxed()
}
};
let call = transport
.call(
SERVICE_NAME.as_cstr(),
METHOD_NAME.as_cstr(),
request_env,
rpc_options,
)
.instrument(::tracing::trace_span!(
"call",
function = "GraphService.executeJson"
));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let (res, _de): (
::std::result::Result<super::services::graph_service::ExecuteJsonExn, _>,
_,
) = crate::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de)
.await?;
let res = match res {
::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
::std::result::Result::Err(aexn) => ::std::result::Result::Err(
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError::ApplicationException(aexn),
),
};
res
}
.instrument(::tracing::info_span!("GraphService.executeJson"))
.boxed()
}
fn _executeJsonWithParameter_impl(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError,
>,
>{
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
use ::tracing::Instrument as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.executeJsonWithParameter";
}
let args = self::Args_GraphService_executeJsonWithParameter {
sessionId: arg_sessionId,
stmt: arg_stmt,
parameterMap: arg_parameterMap,
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
let request_env = match crate::fbthrift::help::serialize_request_envelope::<P, _>(
"executeJsonWithParameter",
&args,
) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => {
return ::futures::future::err(err.into()).boxed()
}
};
let call = transport
.call(
SERVICE_NAME.as_cstr(),
METHOD_NAME.as_cstr(),
request_env,
rpc_options,
)
.instrument(::tracing::trace_span!(
"call",
function = "GraphService.executeJsonWithParameter"
));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let (res, _de): (
::std::result::Result<
super::services::graph_service::ExecuteJsonWithParameterExn,
_,
>,
_,
) = crate::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de)
.await?;
let res = match res {
::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
::std::result::Result::Err(aexn) => ::std::result::Result::Err(
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError::ApplicationException(
aexn,
),
),
};
res
}
.instrument(::tracing::info_span!(
"GraphService.executeJsonWithParameter"
))
.boxed()
}
fn _verifyClientVersion_impl(
&self,
arg_req: &crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
>,
> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
use ::tracing::Instrument as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.verifyClientVersion";
}
let args = self::Args_GraphService_verifyClientVersion {
req: arg_req,
_phantom: ::std::marker::PhantomData,
};
let transport = self.transport();
let request_env = match crate::fbthrift::help::serialize_request_envelope::<P, _>(
"verifyClientVersion",
&args,
) {
::std::result::Result::Ok(res) => res,
::std::result::Result::Err(err) => {
return ::futures::future::err(err.into()).boxed()
}
};
let call = transport
.call(
SERVICE_NAME.as_cstr(),
METHOD_NAME.as_cstr(),
request_env,
rpc_options,
)
.instrument(::tracing::trace_span!(
"call",
function = "GraphService.verifyClientVersion"
));
async move {
let reply_env = call.await?;
let de = P::deserializer(reply_env);
let (res, _de): (
::std::result::Result<
super::services::graph_service::VerifyClientVersionExn,
_,
>,
_,
) = crate::fbthrift::help::async_deserialize_response_envelope::<P, _, S>(de)
.await?;
let res = match res {
::std::result::Result::Ok(exn) => ::std::convert::From::from(exn),
::std::result::Result::Err(aexn) => ::std::result::Result::Err(
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError::ApplicationException(aexn),
),
};
res
}
.instrument(::tracing::info_span!("GraphService.verifyClientVersion"))
.boxed()
}
}
pub trait GraphService: ::std::marker::Send {
fn authenticate(
&self,
arg_username: &::std::vec::Vec<::std::primitive::u8>,
arg_password: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
>,
>;
fn signout(
&self,
arg_sessionId: ::std::primitive::i64,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
(),
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
>,
>;
fn execute(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
>,
>;
fn executeWithParameter(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
>,
>;
fn executeJson(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
>,
>;
fn executeJsonWithParameter(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError,
>,
>;
fn verifyClientVersion(
&self,
arg_req: &crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
>,
>;
}
pub trait GraphServiceExt<T>: GraphService
where
T: crate::fbthrift::Transport,
{
fn authenticate_with_rpc_opts(
&self,
arg_username: &::std::vec::Vec<::std::primitive::u8>,
arg_password: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
>,
>;
fn signout_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
(),
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
>,
>;
fn execute_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
>,
>;
fn executeWithParameter_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
>,
>;
fn executeJson_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
>,
>;
fn executeJsonWithParameter_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError,
>,
>;
fn verifyClientVersion_with_rpc_opts(
&self,
arg_req: &crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
>,
>;
}
struct Args_GraphService_authenticate<'a> {
username: &'a ::std::vec::Vec<::std::primitive::u8>,
password: &'a ::std::vec::Vec<::std::primitive::u8>,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: crate::fbthrift::ProtocolWriter> crate::fbthrift::Serialize<P>
for self::Args_GraphService_authenticate<'a>
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "serialize_args",
fields(method = "GraphService.authenticate")
)]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("username", crate::fbthrift::TType::String, 1i16);
crate::fbthrift::Serialize::write(&self.username, p);
p.write_field_end();
p.write_field_begin("password", crate::fbthrift::TType::String, 2i16);
crate::fbthrift::Serialize::write(&self.password, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_GraphService_signout<'a> {
sessionId: ::std::primitive::i64,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: crate::fbthrift::ProtocolWriter> crate::fbthrift::Serialize<P>
for self::Args_GraphService_signout<'a>
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "serialize_args",
fields(method = "GraphService.signout")
)]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("sessionId", crate::fbthrift::TType::I64, 1i16);
crate::fbthrift::Serialize::write(&self.sessionId, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_GraphService_execute<'a> {
sessionId: ::std::primitive::i64,
stmt: &'a ::std::vec::Vec<::std::primitive::u8>,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: crate::fbthrift::ProtocolWriter> crate::fbthrift::Serialize<P>
for self::Args_GraphService_execute<'a>
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "serialize_args",
fields(method = "GraphService.execute")
)]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("sessionId", crate::fbthrift::TType::I64, 1i16);
crate::fbthrift::Serialize::write(&self.sessionId, p);
p.write_field_end();
p.write_field_begin("stmt", crate::fbthrift::TType::String, 2i16);
crate::fbthrift::Serialize::write(&self.stmt, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_GraphService_executeWithParameter<'a> {
sessionId: ::std::primitive::i64,
stmt: &'a ::std::vec::Vec<::std::primitive::u8>,
parameterMap: &'a ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: crate::fbthrift::ProtocolWriter> crate::fbthrift::Serialize<P>
for self::Args_GraphService_executeWithParameter<'a>
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "serialize_args",
fields(method = "GraphService.executeWithParameter")
)]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("sessionId", crate::fbthrift::TType::I64, 1i16);
crate::fbthrift::Serialize::write(&self.sessionId, p);
p.write_field_end();
p.write_field_begin("stmt", crate::fbthrift::TType::String, 2i16);
crate::fbthrift::Serialize::write(&self.stmt, p);
p.write_field_end();
p.write_field_begin("parameterMap", crate::fbthrift::TType::Map, 3i16);
crate::fbthrift::Serialize::write(&self.parameterMap, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_GraphService_executeJson<'a> {
sessionId: ::std::primitive::i64,
stmt: &'a ::std::vec::Vec<::std::primitive::u8>,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: crate::fbthrift::ProtocolWriter> crate::fbthrift::Serialize<P>
for self::Args_GraphService_executeJson<'a>
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "serialize_args",
fields(method = "GraphService.executeJson")
)]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("sessionId", crate::fbthrift::TType::I64, 1i16);
crate::fbthrift::Serialize::write(&self.sessionId, p);
p.write_field_end();
p.write_field_begin("stmt", crate::fbthrift::TType::String, 2i16);
crate::fbthrift::Serialize::write(&self.stmt, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_GraphService_executeJsonWithParameter<'a> {
sessionId: ::std::primitive::i64,
stmt: &'a ::std::vec::Vec<::std::primitive::u8>,
parameterMap: &'a ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: crate::fbthrift::ProtocolWriter> crate::fbthrift::Serialize<P>
for self::Args_GraphService_executeJsonWithParameter<'a>
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "serialize_args",
fields(method = "GraphService.executeJsonWithParameter")
)]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("sessionId", crate::fbthrift::TType::I64, 1i16);
crate::fbthrift::Serialize::write(&self.sessionId, p);
p.write_field_end();
p.write_field_begin("stmt", crate::fbthrift::TType::String, 2i16);
crate::fbthrift::Serialize::write(&self.stmt, p);
p.write_field_end();
p.write_field_begin("parameterMap", crate::fbthrift::TType::Map, 3i16);
crate::fbthrift::Serialize::write(&self.parameterMap, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
struct Args_GraphService_verifyClientVersion<'a> {
req: &'a crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
_phantom: ::std::marker::PhantomData<&'a ()>,
}
impl<'a, P: crate::fbthrift::ProtocolWriter> crate::fbthrift::Serialize<P>
for self::Args_GraphService_verifyClientVersion<'a>
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "serialize_args",
fields(method = "GraphService.verifyClientVersion")
)]
fn write(&self, p: &mut P) {
p.write_struct_begin("args");
p.write_field_begin("req", crate::fbthrift::TType::Struct, 1i16);
crate::fbthrift::Serialize::write(&self.req, p);
p.write_field_end();
p.write_field_stop();
p.write_struct_end();
}
}
impl<P, T, S> GraphService for GraphServiceImpl<P, T, S>
where
P: crate::fbthrift::Protocol,
T: crate::fbthrift::Transport,
P::Frame: crate::fbthrift::Framing<DecBuf = crate::fbthrift::FramingDecoded<T>>,
crate::fbthrift::ProtocolEncoded<P>:
crate::fbthrift::BufMutExt<Final = crate::fbthrift::FramingEncodedFinal<T>>,
P::Deserializer: ::std::marker::Send,
S: crate::fbthrift::help::Spawner,
{
fn authenticate(
&self,
arg_username: &::std::vec::Vec<::std::primitive::u8>,
arg_password: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
>,
> {
let rpc_options = T::RpcOptions::default();
self._authenticate_impl(arg_username, arg_password, rpc_options)
}
fn signout(
&self,
arg_sessionId: ::std::primitive::i64,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
(),
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
>,
> {
let rpc_options = T::RpcOptions::default();
self._signout_impl(arg_sessionId, rpc_options)
}
fn execute(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
>,
> {
let rpc_options = T::RpcOptions::default();
self._execute_impl(arg_sessionId, arg_stmt, rpc_options)
}
fn executeWithParameter(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
>,
> {
let rpc_options = T::RpcOptions::default();
self._executeWithParameter_impl(arg_sessionId, arg_stmt, arg_parameterMap, rpc_options)
}
fn executeJson(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
>,
> {
let rpc_options = T::RpcOptions::default();
self._executeJson_impl(arg_sessionId, arg_stmt, rpc_options)
}
fn executeJsonWithParameter(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError,
>,
>{
let rpc_options = T::RpcOptions::default();
self._executeJsonWithParameter_impl(
arg_sessionId,
arg_stmt,
arg_parameterMap,
rpc_options,
)
}
fn verifyClientVersion(
&self,
arg_req: &crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
>,
> {
let rpc_options = T::RpcOptions::default();
self._verifyClientVersion_impl(arg_req, rpc_options)
}
}
impl<P, T, S> GraphServiceExt<T> for GraphServiceImpl<P, T, S>
where
P: crate::fbthrift::Protocol,
T: crate::fbthrift::Transport,
P::Frame: crate::fbthrift::Framing<DecBuf = crate::fbthrift::FramingDecoded<T>>,
crate::fbthrift::ProtocolEncoded<P>:
crate::fbthrift::BufMutExt<Final = crate::fbthrift::FramingEncodedFinal<T>>,
P::Deserializer: ::std::marker::Send,
S: crate::fbthrift::help::Spawner,
{
fn authenticate_with_rpc_opts(
&self,
arg_username: &::std::vec::Vec<::std::primitive::u8>,
arg_password: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
>,
> {
self._authenticate_impl(arg_username, arg_password, rpc_options)
}
fn signout_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
(),
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
>,
> {
self._signout_impl(arg_sessionId, rpc_options)
}
fn execute_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
>,
> {
self._execute_impl(arg_sessionId, arg_stmt, rpc_options)
}
fn executeWithParameter_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
>,
> {
self._executeWithParameter_impl(arg_sessionId, arg_stmt, arg_parameterMap, rpc_options)
}
fn executeJson_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
>,
> {
self._executeJson_impl(arg_sessionId, arg_stmt, rpc_options)
}
fn executeJsonWithParameter_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError,
>,
>{
self._executeJsonWithParameter_impl(
arg_sessionId,
arg_stmt,
arg_parameterMap,
rpc_options,
)
}
fn verifyClientVersion_with_rpc_opts(
&self,
arg_req: &crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
>,
> {
self._verifyClientVersion_impl(arg_req, rpc_options)
}
}
impl<'a, S> GraphService for S
where
S: ::std::convert::AsRef<dyn GraphService + 'a>,
S: ::std::marker::Send,
{
fn authenticate(
&self,
arg_username: &::std::vec::Vec<::std::primitive::u8>,
arg_password: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
>,
> {
self.as_ref().authenticate(arg_username, arg_password)
}
fn signout(
&self,
arg_sessionId: ::std::primitive::i64,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
(),
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
>,
> {
self.as_ref().signout(arg_sessionId)
}
fn execute(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
>,
> {
self.as_ref().execute(arg_sessionId, arg_stmt)
}
fn executeWithParameter(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
>,
> {
self.as_ref()
.executeWithParameter(arg_sessionId, arg_stmt, arg_parameterMap)
}
fn executeJson(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
>,
> {
self.as_ref().executeJson(arg_sessionId, arg_stmt)
}
fn executeJsonWithParameter(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError,
>,
>{
self.as_ref()
.executeJsonWithParameter(arg_sessionId, arg_stmt, arg_parameterMap)
}
fn verifyClientVersion(
&self,
arg_req: &crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
>,
> {
self.as_ref().verifyClientVersion(arg_req)
}
}
impl<'a, S, T> GraphServiceExt<T> for S
where
S: ::std::convert::AsRef<dyn GraphService + 'a>,
S: ::std::convert::AsRef<dyn GraphServiceExt<T> + 'a>,
S: ::std::marker::Send,
T: crate::fbthrift::Transport,
{
fn authenticate_with_rpc_opts(
&self,
arg_username: &::std::vec::Vec<::std::primitive::u8>,
arg_password: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
>,
> {
<Self as ::std::convert::AsRef<dyn GraphServiceExt<T>>>::as_ref(self)
.authenticate_with_rpc_opts(arg_username, arg_password, rpc_options)
}
fn signout_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
(),
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
>,
> {
<Self as ::std::convert::AsRef<dyn GraphServiceExt<T>>>::as_ref(self)
.signout_with_rpc_opts(arg_sessionId, rpc_options)
}
fn execute_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
>,
> {
<Self as ::std::convert::AsRef<dyn GraphServiceExt<T>>>::as_ref(self)
.execute_with_rpc_opts(arg_sessionId, arg_stmt, rpc_options)
}
fn executeWithParameter_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
>,
> {
<Self as ::std::convert::AsRef<dyn GraphServiceExt<T>>>::as_ref(self)
.executeWithParameter_with_rpc_opts(
arg_sessionId,
arg_stmt,
arg_parameterMap,
rpc_options,
)
}
fn executeJson_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
>,
> {
<Self as ::std::convert::AsRef<dyn GraphServiceExt<T>>>::as_ref(self)
.executeJson_with_rpc_opts(arg_sessionId, arg_stmt, rpc_options)
}
fn executeJsonWithParameter_with_rpc_opts(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError,
>,
>{
<Self as ::std::convert::AsRef<dyn GraphServiceExt<T>>>::as_ref(self)
.executeJsonWithParameter_with_rpc_opts(
arg_sessionId,
arg_stmt,
arg_parameterMap,
rpc_options,
)
}
fn verifyClientVersion_with_rpc_opts(
&self,
arg_req: &crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
rpc_options: T::RpcOptions,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
>,
> {
<Self as ::std::convert::AsRef<dyn GraphServiceExt<T>>>::as_ref(self)
.verifyClientVersion_with_rpc_opts(arg_req, rpc_options)
}
}
#[derive(Clone)]
pub struct make_GraphService;
impl dyn GraphService {
pub fn new<P, T>(
protocol: P,
transport: T,
) -> ::std::sync::Arc<impl GraphService + ::std::marker::Send + ::std::marker::Sync + 'static>
where
P: crate::fbthrift::Protocol<Frame = T>,
T: crate::fbthrift::Transport,
P::Deserializer: ::std::marker::Send,
{
let spawner = crate::fbthrift::help::NoopSpawner;
Self::with_spawner(protocol, transport, spawner)
}
pub fn with_spawner<P, T, S>(
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc<impl GraphService + ::std::marker::Send + ::std::marker::Sync + 'static>
where
P: crate::fbthrift::Protocol<Frame = T>,
T: crate::fbthrift::Transport,
P::Deserializer: ::std::marker::Send,
S: crate::fbthrift::help::Spawner,
{
let _ = protocol;
let _ = spawner;
::std::sync::Arc::new(GraphServiceImpl::<P, T, S>::new(transport))
}
}
impl<T> dyn GraphServiceExt<T>
where
T: crate::fbthrift::Transport,
{
pub fn new<P>(
protocol: P,
transport: T,
) -> ::std::sync::Arc<
impl GraphServiceExt<T> + ::std::marker::Send + ::std::marker::Sync + 'static,
>
where
P: crate::fbthrift::Protocol<Frame = T>,
P::Deserializer: ::std::marker::Send,
{
let spawner = crate::fbthrift::help::NoopSpawner;
Self::with_spawner(protocol, transport, spawner)
}
pub fn with_spawner<P, S>(
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc<
impl GraphServiceExt<T> + ::std::marker::Send + ::std::marker::Sync + 'static,
>
where
P: crate::fbthrift::Protocol<Frame = T>,
P::Deserializer: ::std::marker::Send,
S: crate::fbthrift::help::Spawner,
{
let _ = protocol;
let _ = spawner;
::std::sync::Arc::new(GraphServiceImpl::<P, T, S>::new(transport))
}
}
pub type GraphServiceDynClient = <make_GraphService as crate::fbthrift::ClientFactory>::Api;
pub type GraphServiceClient = ::std::sync::Arc<GraphServiceDynClient>;
impl crate::fbthrift::ClientFactory for make_GraphService {
type Api = dyn GraphService + ::std::marker::Send + ::std::marker::Sync + 'static;
fn with_spawner<P, T, S>(
protocol: P,
transport: T,
spawner: S,
) -> ::std::sync::Arc<Self::Api>
where
P: crate::fbthrift::Protocol<Frame = T>,
T: crate::fbthrift::Transport,
P::Deserializer: ::std::marker::Send,
S: crate::fbthrift::help::Spawner,
{
<dyn GraphService>::with_spawner(protocol, transport, spawner)
}
}
}
pub mod server {
use crate::fbthrift_protocol::common;
#[::async_trait::async_trait]
pub trait GraphService: ::std::marker::Send + ::std::marker::Sync + 'static {
async fn authenticate(
&self,
_username: ::std::vec::Vec<::std::primitive::u8>,
_password: ::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
super::services::graph_service::AuthenticateExn,
> {
::std::result::Result::Err(
super::services::graph_service::AuthenticateExn::ApplicationException(
crate::fbthrift::ApplicationException::unimplemented_method(
"GraphService",
"authenticate",
),
),
)
}
async fn signout(
&self,
_sessionId: ::std::primitive::i64,
) -> ::std::result::Result<(), super::services::graph_service::SignoutExn> {
::std::result::Result::Err(
super::services::graph_service::SignoutExn::ApplicationException(
crate::fbthrift::ApplicationException::unimplemented_method(
"GraphService",
"signout",
),
),
)
}
async fn execute(
&self,
_sessionId: ::std::primitive::i64,
_stmt: ::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
super::services::graph_service::ExecuteExn,
> {
::std::result::Result::Err(
super::services::graph_service::ExecuteExn::ApplicationException(
crate::fbthrift::ApplicationException::unimplemented_method(
"GraphService",
"execute",
),
),
)
}
async fn executeWithParameter(
&self,
_sessionId: ::std::primitive::i64,
_stmt: ::std::vec::Vec<::std::primitive::u8>,
_parameterMap: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
super::services::graph_service::ExecuteWithParameterExn,
> {
::std::result::Result::Err(
super::services::graph_service::ExecuteWithParameterExn::ApplicationException(
crate::fbthrift::ApplicationException::unimplemented_method(
"GraphService",
"executeWithParameter",
),
),
)
}
async fn executeJson(
&self,
_sessionId: ::std::primitive::i64,
_stmt: ::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
super::services::graph_service::ExecuteJsonExn,
> {
::std::result::Result::Err(
super::services::graph_service::ExecuteJsonExn::ApplicationException(
crate::fbthrift::ApplicationException::unimplemented_method(
"GraphService",
"executeJson",
),
),
)
}
async fn executeJsonWithParameter(
&self,
_sessionId: ::std::primitive::i64,
_stmt: ::std::vec::Vec<::std::primitive::u8>,
_parameterMap: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
super::services::graph_service::ExecuteJsonWithParameterExn,
> {
::std::result::Result::Err(
super::services::graph_service::ExecuteJsonWithParameterExn::ApplicationException(
crate::fbthrift::ApplicationException::unimplemented_method(
"GraphService",
"executeJsonWithParameter",
),
),
)
}
async fn verifyClientVersion(
&self,
_req: crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
super::services::graph_service::VerifyClientVersionExn,
> {
::std::result::Result::Err(
super::services::graph_service::VerifyClientVersionExn::ApplicationException(
crate::fbthrift::ApplicationException::unimplemented_method(
"GraphService",
"verifyClientVersion",
),
),
)
}
}
#[::async_trait::async_trait]
impl<T> GraphService for ::std::boxed::Box<T>
where
T: GraphService + Send + Sync + ?Sized,
{
async fn authenticate(
&self,
username: ::std::vec::Vec<::std::primitive::u8>,
password: ::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
super::services::graph_service::AuthenticateExn,
> {
(**self).authenticate(username, password).await
}
async fn signout(
&self,
sessionId: ::std::primitive::i64,
) -> ::std::result::Result<(), super::services::graph_service::SignoutExn> {
(**self).signout(sessionId).await
}
async fn execute(
&self,
sessionId: ::std::primitive::i64,
stmt: ::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
super::services::graph_service::ExecuteExn,
> {
(**self).execute(sessionId, stmt).await
}
async fn executeWithParameter(
&self,
sessionId: ::std::primitive::i64,
stmt: ::std::vec::Vec<::std::primitive::u8>,
parameterMap: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
super::services::graph_service::ExecuteWithParameterExn,
> {
(**self)
.executeWithParameter(sessionId, stmt, parameterMap)
.await
}
async fn executeJson(
&self,
sessionId: ::std::primitive::i64,
stmt: ::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
super::services::graph_service::ExecuteJsonExn,
> {
(**self).executeJson(sessionId, stmt).await
}
async fn executeJsonWithParameter(
&self,
sessionId: ::std::primitive::i64,
stmt: ::std::vec::Vec<::std::primitive::u8>,
parameterMap: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
super::services::graph_service::ExecuteJsonWithParameterExn,
> {
(**self)
.executeJsonWithParameter(sessionId, stmt, parameterMap)
.await
}
async fn verifyClientVersion(
&self,
req: crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
super::services::graph_service::VerifyClientVersionExn,
> {
(**self).verifyClientVersion(req).await
}
}
#[derive(Clone, Debug)]
pub struct GraphServiceProcessor<P, H, R, RS> {
service: H,
supa: crate::fbthrift::NullServiceProcessor<P, R, RS>,
_phantom: ::std::marker::PhantomData<(P, H, R, RS)>,
}
struct Args_GraphService_authenticate {
username: ::std::vec::Vec<::std::primitive::u8>,
password: ::std::vec::Vec<::std::primitive::u8>,
}
impl<P: crate::fbthrift::ProtocolReader> crate::fbthrift::Deserialize<P>
for self::Args_GraphService_authenticate
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "deserialize_args",
fields(method = "GraphService.authenticate")
)]
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static ARGS: &[crate::fbthrift::Field] = &[
crate::fbthrift::Field::new("password", crate::fbthrift::TType::String, 2),
crate::fbthrift::Field::new("username", crate::fbthrift::TType::String, 1),
];
let mut field_username = ::std::option::Option::None;
let mut field_password = ::std::option::Option::None;
let _ = p.read_struct_begin(|_| ())?;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
match (fty, fid as ::std::primitive::i32) {
(crate::fbthrift::TType::Stop, _) => break,
(crate::fbthrift::TType::String, 1) => {
field_username =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(crate::fbthrift::TType::String, 2) => {
field_password =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(fty, _) => p.skip(fty)?,
}
p.read_field_end()?;
}
p.read_struct_end()?;
::std::result::Result::Ok(Self {
username: field_username.ok_or_else(|| {
::anyhow::anyhow!(
"`{}` missing arg `{}`",
"GraphService.authenticate",
"username"
)
})?,
password: field_password.ok_or_else(|| {
::anyhow::anyhow!(
"`{}` missing arg `{}`",
"GraphService.authenticate",
"password"
)
})?,
})
}
}
struct Args_GraphService_signout {
sessionId: ::std::primitive::i64,
}
impl<P: crate::fbthrift::ProtocolReader> crate::fbthrift::Deserialize<P>
for self::Args_GraphService_signout
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "deserialize_args",
fields(method = "GraphService.signout")
)]
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static ARGS: &[crate::fbthrift::Field] = &[crate::fbthrift::Field::new(
"sessionId",
crate::fbthrift::TType::I64,
1,
)];
let mut field_sessionId = ::std::option::Option::None;
let _ = p.read_struct_begin(|_| ())?;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
match (fty, fid as ::std::primitive::i32) {
(crate::fbthrift::TType::Stop, _) => break,
(crate::fbthrift::TType::I64, 1) => {
field_sessionId =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(fty, _) => p.skip(fty)?,
}
p.read_field_end()?;
}
p.read_struct_end()?;
::std::result::Result::Ok(Self {
sessionId: field_sessionId.ok_or_else(|| {
::anyhow::anyhow!("`{}` missing arg `{}`", "GraphService.signout", "sessionId")
})?,
})
}
}
struct Args_GraphService_execute {
sessionId: ::std::primitive::i64,
stmt: ::std::vec::Vec<::std::primitive::u8>,
}
impl<P: crate::fbthrift::ProtocolReader> crate::fbthrift::Deserialize<P>
for self::Args_GraphService_execute
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "deserialize_args",
fields(method = "GraphService.execute")
)]
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static ARGS: &[crate::fbthrift::Field] = &[
crate::fbthrift::Field::new("sessionId", crate::fbthrift::TType::I64, 1),
crate::fbthrift::Field::new("stmt", crate::fbthrift::TType::String, 2),
];
let mut field_sessionId = ::std::option::Option::None;
let mut field_stmt = ::std::option::Option::None;
let _ = p.read_struct_begin(|_| ())?;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
match (fty, fid as ::std::primitive::i32) {
(crate::fbthrift::TType::Stop, _) => break,
(crate::fbthrift::TType::I64, 1) => {
field_sessionId =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(crate::fbthrift::TType::String, 2) => {
field_stmt =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(fty, _) => p.skip(fty)?,
}
p.read_field_end()?;
}
p.read_struct_end()?;
::std::result::Result::Ok(Self {
sessionId: field_sessionId.ok_or_else(|| {
::anyhow::anyhow!("`{}` missing arg `{}`", "GraphService.execute", "sessionId")
})?,
stmt: field_stmt.ok_or_else(|| {
::anyhow::anyhow!("`{}` missing arg `{}`", "GraphService.execute", "stmt")
})?,
})
}
}
struct Args_GraphService_executeWithParameter {
sessionId: ::std::primitive::i64,
stmt: ::std::vec::Vec<::std::primitive::u8>,
parameterMap: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
}
impl<P: crate::fbthrift::ProtocolReader> crate::fbthrift::Deserialize<P>
for self::Args_GraphService_executeWithParameter
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "deserialize_args",
fields(method = "GraphService.executeWithParameter")
)]
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static ARGS: &[crate::fbthrift::Field] = &[
crate::fbthrift::Field::new("parameterMap", crate::fbthrift::TType::Map, 3),
crate::fbthrift::Field::new("sessionId", crate::fbthrift::TType::I64, 1),
crate::fbthrift::Field::new("stmt", crate::fbthrift::TType::String, 2),
];
let mut field_sessionId = ::std::option::Option::None;
let mut field_stmt = ::std::option::Option::None;
let mut field_parameterMap = ::std::option::Option::None;
let _ = p.read_struct_begin(|_| ())?;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
match (fty, fid as ::std::primitive::i32) {
(crate::fbthrift::TType::Stop, _) => break,
(crate::fbthrift::TType::I64, 1) => {
field_sessionId =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(crate::fbthrift::TType::String, 2) => {
field_stmt =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(crate::fbthrift::TType::Map, 3) => {
field_parameterMap =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(fty, _) => p.skip(fty)?,
}
p.read_field_end()?;
}
p.read_struct_end()?;
::std::result::Result::Ok(Self {
sessionId: field_sessionId.ok_or_else(|| {
::anyhow::anyhow!(
"`{}` missing arg `{}`",
"GraphService.executeWithParameter",
"sessionId"
)
})?,
stmt: field_stmt.ok_or_else(|| {
::anyhow::anyhow!(
"`{}` missing arg `{}`",
"GraphService.executeWithParameter",
"stmt"
)
})?,
parameterMap: field_parameterMap.ok_or_else(|| {
::anyhow::anyhow!(
"`{}` missing arg `{}`",
"GraphService.executeWithParameter",
"parameterMap"
)
})?,
})
}
}
struct Args_GraphService_executeJson {
sessionId: ::std::primitive::i64,
stmt: ::std::vec::Vec<::std::primitive::u8>,
}
impl<P: crate::fbthrift::ProtocolReader> crate::fbthrift::Deserialize<P>
for self::Args_GraphService_executeJson
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "deserialize_args",
fields(method = "GraphService.executeJson")
)]
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static ARGS: &[crate::fbthrift::Field] = &[
crate::fbthrift::Field::new("sessionId", crate::fbthrift::TType::I64, 1),
crate::fbthrift::Field::new("stmt", crate::fbthrift::TType::String, 2),
];
let mut field_sessionId = ::std::option::Option::None;
let mut field_stmt = ::std::option::Option::None;
let _ = p.read_struct_begin(|_| ())?;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
match (fty, fid as ::std::primitive::i32) {
(crate::fbthrift::TType::Stop, _) => break,
(crate::fbthrift::TType::I64, 1) => {
field_sessionId =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(crate::fbthrift::TType::String, 2) => {
field_stmt =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(fty, _) => p.skip(fty)?,
}
p.read_field_end()?;
}
p.read_struct_end()?;
::std::result::Result::Ok(Self {
sessionId: field_sessionId.ok_or_else(|| {
::anyhow::anyhow!(
"`{}` missing arg `{}`",
"GraphService.executeJson",
"sessionId"
)
})?,
stmt: field_stmt.ok_or_else(|| {
::anyhow::anyhow!("`{}` missing arg `{}`", "GraphService.executeJson", "stmt")
})?,
})
}
}
struct Args_GraphService_executeJsonWithParameter {
sessionId: ::std::primitive::i64,
stmt: ::std::vec::Vec<::std::primitive::u8>,
parameterMap: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
}
impl<P: crate::fbthrift::ProtocolReader> crate::fbthrift::Deserialize<P>
for self::Args_GraphService_executeJsonWithParameter
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "deserialize_args",
fields(method = "GraphService.executeJsonWithParameter")
)]
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static ARGS: &[crate::fbthrift::Field] = &[
crate::fbthrift::Field::new("parameterMap", crate::fbthrift::TType::Map, 3),
crate::fbthrift::Field::new("sessionId", crate::fbthrift::TType::I64, 1),
crate::fbthrift::Field::new("stmt", crate::fbthrift::TType::String, 2),
];
let mut field_sessionId = ::std::option::Option::None;
let mut field_stmt = ::std::option::Option::None;
let mut field_parameterMap = ::std::option::Option::None;
let _ = p.read_struct_begin(|_| ())?;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
match (fty, fid as ::std::primitive::i32) {
(crate::fbthrift::TType::Stop, _) => break,
(crate::fbthrift::TType::I64, 1) => {
field_sessionId =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(crate::fbthrift::TType::String, 2) => {
field_stmt =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(crate::fbthrift::TType::Map, 3) => {
field_parameterMap =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(fty, _) => p.skip(fty)?,
}
p.read_field_end()?;
}
p.read_struct_end()?;
::std::result::Result::Ok(Self {
sessionId: field_sessionId.ok_or_else(|| {
::anyhow::anyhow!(
"`{}` missing arg `{}`",
"GraphService.executeJsonWithParameter",
"sessionId"
)
})?,
stmt: field_stmt.ok_or_else(|| {
::anyhow::anyhow!(
"`{}` missing arg `{}`",
"GraphService.executeJsonWithParameter",
"stmt"
)
})?,
parameterMap: field_parameterMap.ok_or_else(|| {
::anyhow::anyhow!(
"`{}` missing arg `{}`",
"GraphService.executeJsonWithParameter",
"parameterMap"
)
})?,
})
}
}
struct Args_GraphService_verifyClientVersion {
req: crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
}
impl<P: crate::fbthrift::ProtocolReader> crate::fbthrift::Deserialize<P>
for self::Args_GraphService_verifyClientVersion
{
#[inline]
#[::tracing::instrument(
skip_all,
level = "trace",
name = "deserialize_args",
fields(method = "GraphService.verifyClientVersion")
)]
fn read(p: &mut P) -> ::anyhow::Result<Self> {
static ARGS: &[crate::fbthrift::Field] = &[crate::fbthrift::Field::new(
"req",
crate::fbthrift::TType::Struct,
1,
)];
let mut field_req = ::std::option::Option::None;
let _ = p.read_struct_begin(|_| ())?;
loop {
let (_, fty, fid) = p.read_field_begin(|_| (), ARGS)?;
match (fty, fid as ::std::primitive::i32) {
(crate::fbthrift::TType::Stop, _) => break,
(crate::fbthrift::TType::Struct, 1) => {
field_req =
::std::option::Option::Some(crate::fbthrift::Deserialize::read(p)?)
}
(fty, _) => p.skip(fty)?,
}
p.read_field_end()?;
}
p.read_struct_end()?;
::std::result::Result::Ok(Self {
req: field_req.ok_or_else(|| {
::anyhow::anyhow!(
"`{}` missing arg `{}`",
"GraphService.verifyClientVersion",
"req"
)
})?,
})
}
}
impl<P, H, R, RS> GraphServiceProcessor<P, H, R, RS>
where
P: crate::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
P::Frame: ::std::marker::Send + 'static,
P::Deserializer: ::std::marker::Send,
H: GraphService,
R: crate::fbthrift::RequestContext<Name = ::std::ffi::CStr>
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'static,
RS: crate::fbthrift::ReplyState<P::Frame, RequestContext = R>
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'static,
<R as crate::fbthrift::RequestContext>::ContextStack: crate::fbthrift::ContextStack<
Name = R::Name,
Buffer = crate::fbthrift::ProtocolDecoded<P>,
> + ::std::marker::Send
+ ::std::marker::Sync,
{
pub fn new(service: H) -> Self {
Self {
service,
supa: crate::fbthrift::NullServiceProcessor::new(),
_phantom: ::std::marker::PhantomData,
}
}
pub fn into_inner(self) -> H {
self.service
}
#[::tracing::instrument(
skip_all,
name = "handler",
fields(method = "GraphService.authenticate")
)]
async fn handle_authenticate<'a>(
&'a self,
p: &'a mut P::Deserializer,
req_ctxt: &R,
reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
_seqid: ::std::primitive::u32,
) -> ::anyhow::Result<()> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.authenticate";
}
let mut ctx_stack =
req_ctxt.get_context_stack(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr())?;
crate::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
let _args: self::Args_GraphService_authenticate =
crate::fbthrift::Deserialize::read(p)?;
crate::fbthrift::ContextStack::on_read_data(
&mut ctx_stack,
&crate::fbthrift::SerializedMessage {
protocol: P::PROTOCOL_ID,
method_name: METHOD_NAME.as_cstr(),
buffer: ::std::marker::PhantomData, },
)?;
crate::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
let res = ::std::panic::AssertUnwindSafe(
self.service.authenticate(_args.username, _args.password),
)
.catch_unwind()
.await;
let res = match res {
::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
::tracing::info!("success");
super::services::graph_service::AuthenticateExn::Success(res)
}
::std::result::Result::Ok(::std::result::Result::Err(
super::services::graph_service::AuthenticateExn::Success(_),
)) => {
panic!("{} attempted to return success via error", "authenticate",)
}
::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
::tracing::error!(exception = ?exn);
exn
}
::std::result::Result::Err(exn) => {
let aexn = crate::fbthrift::ApplicationException::handler_panic(
"GraphService.authenticate",
exn,
);
super::services::graph_service::AuthenticateExn::ApplicationException(aexn)
}
};
let env = crate::fbthrift::help::serialize_result_envelope::<P, R, _>(
"authenticate",
METHOD_NAME.as_cstr(),
_seqid,
req_ctxt,
&mut ctx_stack,
res,
)?;
reply_state.lock().unwrap().send_reply(env);
Ok(())
}
#[::tracing::instrument(
skip_all,
name = "handler",
fields(method = "GraphService.signout")
)]
async fn handle_signout<'a>(
&'a self,
p: &'a mut P::Deserializer,
req_ctxt: &R,
reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
_seqid: ::std::primitive::u32,
) -> ::anyhow::Result<()> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.signout";
}
let mut ctx_stack =
req_ctxt.get_context_stack(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr())?;
crate::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
let _args: self::Args_GraphService_signout = crate::fbthrift::Deserialize::read(p)?;
crate::fbthrift::ContextStack::on_read_data(
&mut ctx_stack,
&crate::fbthrift::SerializedMessage {
protocol: P::PROTOCOL_ID,
method_name: METHOD_NAME.as_cstr(),
buffer: ::std::marker::PhantomData, },
)?;
crate::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
let res = ::std::panic::AssertUnwindSafe(self.service.signout(_args.sessionId))
.catch_unwind()
.await;
let res = match res {
::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
::tracing::info!("success");
super::services::graph_service::SignoutExn::Success(res)
}
::std::result::Result::Ok(::std::result::Result::Err(
super::services::graph_service::SignoutExn::Success(_),
)) => {
panic!("{} attempted to return success via error", "signout",)
}
::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
::tracing::error!(exception = ?exn);
exn
}
::std::result::Result::Err(exn) => {
let aexn = crate::fbthrift::ApplicationException::handler_panic(
"GraphService.signout",
exn,
);
super::services::graph_service::SignoutExn::ApplicationException(aexn)
}
};
let env = crate::fbthrift::help::serialize_result_envelope::<P, R, _>(
"signout",
METHOD_NAME.as_cstr(),
_seqid,
req_ctxt,
&mut ctx_stack,
res,
)?;
reply_state.lock().unwrap().send_reply(env);
Ok(())
}
#[::tracing::instrument(
skip_all,
name = "handler",
fields(method = "GraphService.execute")
)]
async fn handle_execute<'a>(
&'a self,
p: &'a mut P::Deserializer,
req_ctxt: &R,
reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
_seqid: ::std::primitive::u32,
) -> ::anyhow::Result<()> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.execute";
}
let mut ctx_stack =
req_ctxt.get_context_stack(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr())?;
crate::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
let _args: self::Args_GraphService_execute = crate::fbthrift::Deserialize::read(p)?;
crate::fbthrift::ContextStack::on_read_data(
&mut ctx_stack,
&crate::fbthrift::SerializedMessage {
protocol: P::PROTOCOL_ID,
method_name: METHOD_NAME.as_cstr(),
buffer: ::std::marker::PhantomData, },
)?;
crate::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
let res =
::std::panic::AssertUnwindSafe(self.service.execute(_args.sessionId, _args.stmt))
.catch_unwind()
.await;
let res = match res {
::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
::tracing::info!("success");
super::services::graph_service::ExecuteExn::Success(res)
}
::std::result::Result::Ok(::std::result::Result::Err(
super::services::graph_service::ExecuteExn::Success(_),
)) => {
panic!("{} attempted to return success via error", "execute",)
}
::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
::tracing::error!(exception = ?exn);
exn
}
::std::result::Result::Err(exn) => {
let aexn = crate::fbthrift::ApplicationException::handler_panic(
"GraphService.execute",
exn,
);
super::services::graph_service::ExecuteExn::ApplicationException(aexn)
}
};
let env = crate::fbthrift::help::serialize_result_envelope::<P, R, _>(
"execute",
METHOD_NAME.as_cstr(),
_seqid,
req_ctxt,
&mut ctx_stack,
res,
)?;
reply_state.lock().unwrap().send_reply(env);
Ok(())
}
#[::tracing::instrument(
skip_all,
name = "handler",
fields(method = "GraphService.executeWithParameter")
)]
async fn handle_executeWithParameter<'a>(
&'a self,
p: &'a mut P::Deserializer,
req_ctxt: &R,
reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
_seqid: ::std::primitive::u32,
) -> ::anyhow::Result<()> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.executeWithParameter";
}
let mut ctx_stack =
req_ctxt.get_context_stack(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr())?;
crate::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
let _args: self::Args_GraphService_executeWithParameter =
crate::fbthrift::Deserialize::read(p)?;
crate::fbthrift::ContextStack::on_read_data(
&mut ctx_stack,
&crate::fbthrift::SerializedMessage {
protocol: P::PROTOCOL_ID,
method_name: METHOD_NAME.as_cstr(),
buffer: ::std::marker::PhantomData, },
)?;
crate::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
let res = ::std::panic::AssertUnwindSafe(self.service.executeWithParameter(
_args.sessionId,
_args.stmt,
_args.parameterMap,
))
.catch_unwind()
.await;
let res = match res {
::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
::tracing::info!("success");
super::services::graph_service::ExecuteWithParameterExn::Success(res)
}
::std::result::Result::Ok(::std::result::Result::Err(
super::services::graph_service::ExecuteWithParameterExn::Success(_),
)) => {
panic!(
"{} attempted to return success via error",
"executeWithParameter",
)
}
::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
::tracing::error!(exception = ?exn);
exn
}
::std::result::Result::Err(exn) => {
let aexn = crate::fbthrift::ApplicationException::handler_panic(
"GraphService.executeWithParameter",
exn,
);
super::services::graph_service::ExecuteWithParameterExn::ApplicationException(
aexn,
)
}
};
let env = crate::fbthrift::help::serialize_result_envelope::<P, R, _>(
"executeWithParameter",
METHOD_NAME.as_cstr(),
_seqid,
req_ctxt,
&mut ctx_stack,
res,
)?;
reply_state.lock().unwrap().send_reply(env);
Ok(())
}
#[::tracing::instrument(
skip_all,
name = "handler",
fields(method = "GraphService.executeJson")
)]
async fn handle_executeJson<'a>(
&'a self,
p: &'a mut P::Deserializer,
req_ctxt: &R,
reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
_seqid: ::std::primitive::u32,
) -> ::anyhow::Result<()> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.executeJson";
}
let mut ctx_stack =
req_ctxt.get_context_stack(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr())?;
crate::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
let _args: self::Args_GraphService_executeJson = crate::fbthrift::Deserialize::read(p)?;
crate::fbthrift::ContextStack::on_read_data(
&mut ctx_stack,
&crate::fbthrift::SerializedMessage {
protocol: P::PROTOCOL_ID,
method_name: METHOD_NAME.as_cstr(),
buffer: ::std::marker::PhantomData, },
)?;
crate::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
let res = ::std::panic::AssertUnwindSafe(
self.service.executeJson(_args.sessionId, _args.stmt),
)
.catch_unwind()
.await;
let res = match res {
::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
::tracing::info!("success");
super::services::graph_service::ExecuteJsonExn::Success(res)
}
::std::result::Result::Ok(::std::result::Result::Err(
super::services::graph_service::ExecuteJsonExn::Success(_),
)) => {
panic!("{} attempted to return success via error", "executeJson",)
}
::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
::tracing::error!(exception = ?exn);
exn
}
::std::result::Result::Err(exn) => {
let aexn = crate::fbthrift::ApplicationException::handler_panic(
"GraphService.executeJson",
exn,
);
super::services::graph_service::ExecuteJsonExn::ApplicationException(aexn)
}
};
let env = crate::fbthrift::help::serialize_result_envelope::<P, R, _>(
"executeJson",
METHOD_NAME.as_cstr(),
_seqid,
req_ctxt,
&mut ctx_stack,
res,
)?;
reply_state.lock().unwrap().send_reply(env);
Ok(())
}
#[::tracing::instrument(
skip_all,
name = "handler",
fields(method = "GraphService.executeJsonWithParameter")
)]
async fn handle_executeJsonWithParameter<'a>(
&'a self,
p: &'a mut P::Deserializer,
req_ctxt: &R,
reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
_seqid: ::std::primitive::u32,
) -> ::anyhow::Result<()> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.executeJsonWithParameter";
}
let mut ctx_stack =
req_ctxt.get_context_stack(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr())?;
crate::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
let _args: self::Args_GraphService_executeJsonWithParameter =
crate::fbthrift::Deserialize::read(p)?;
crate::fbthrift::ContextStack::on_read_data(
&mut ctx_stack,
&crate::fbthrift::SerializedMessage {
protocol: P::PROTOCOL_ID,
method_name: METHOD_NAME.as_cstr(),
buffer: ::std::marker::PhantomData, },
)?;
crate::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
let res = ::std::panic::AssertUnwindSafe(self.service.executeJsonWithParameter(
_args.sessionId,
_args.stmt,
_args.parameterMap,
))
.catch_unwind()
.await;
let res = match res {
::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
::tracing::info!("success");
super::services::graph_service::ExecuteJsonWithParameterExn::Success(res)
}
::std::result::Result::Ok(::std::result::Result::Err(
super::services::graph_service::ExecuteJsonWithParameterExn::Success(_),
)) => {
panic!(
"{} attempted to return success via error",
"executeJsonWithParameter",
)
}
::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
::tracing::error!(exception = ?exn);
exn
}
::std::result::Result::Err(exn) => {
let aexn = crate::fbthrift::ApplicationException::handler_panic(
"GraphService.executeJsonWithParameter",
exn,
);
super::services::graph_service::ExecuteJsonWithParameterExn::ApplicationException(aexn)
}
};
let env = crate::fbthrift::help::serialize_result_envelope::<P, R, _>(
"executeJsonWithParameter",
METHOD_NAME.as_cstr(),
_seqid,
req_ctxt,
&mut ctx_stack,
res,
)?;
reply_state.lock().unwrap().send_reply(env);
Ok(())
}
#[::tracing::instrument(
skip_all,
name = "handler",
fields(method = "GraphService.verifyClientVersion")
)]
async fn handle_verifyClientVersion<'a>(
&'a self,
p: &'a mut P::Deserializer,
req_ctxt: &R,
reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
_seqid: ::std::primitive::u32,
) -> ::anyhow::Result<()> {
use ::const_cstr::const_cstr;
use ::futures::FutureExt as _;
const_cstr! {
SERVICE_NAME = "GraphService";
METHOD_NAME = "GraphService.verifyClientVersion";
}
let mut ctx_stack =
req_ctxt.get_context_stack(SERVICE_NAME.as_cstr(), METHOD_NAME.as_cstr())?;
crate::fbthrift::ContextStack::pre_read(&mut ctx_stack)?;
let _args: self::Args_GraphService_verifyClientVersion =
crate::fbthrift::Deserialize::read(p)?;
crate::fbthrift::ContextStack::on_read_data(
&mut ctx_stack,
&crate::fbthrift::SerializedMessage {
protocol: P::PROTOCOL_ID,
method_name: METHOD_NAME.as_cstr(),
buffer: ::std::marker::PhantomData, },
)?;
crate::fbthrift::ContextStack::post_read(&mut ctx_stack, 0)?;
let res = ::std::panic::AssertUnwindSafe(self.service.verifyClientVersion(_args.req))
.catch_unwind()
.await;
let res = match res {
::std::result::Result::Ok(::std::result::Result::Ok(res)) => {
::tracing::info!("success");
super::services::graph_service::VerifyClientVersionExn::Success(res)
}
::std::result::Result::Ok(::std::result::Result::Err(
super::services::graph_service::VerifyClientVersionExn::Success(_),
)) => {
panic!(
"{} attempted to return success via error",
"verifyClientVersion",
)
}
::std::result::Result::Ok(::std::result::Result::Err(exn)) => {
::tracing::error!(exception = ?exn);
exn
}
::std::result::Result::Err(exn) => {
let aexn = crate::fbthrift::ApplicationException::handler_panic(
"GraphService.verifyClientVersion",
exn,
);
super::services::graph_service::VerifyClientVersionExn::ApplicationException(
aexn,
)
}
};
let env = crate::fbthrift::help::serialize_result_envelope::<P, R, _>(
"verifyClientVersion",
METHOD_NAME.as_cstr(),
_seqid,
req_ctxt,
&mut ctx_stack,
res,
)?;
reply_state.lock().unwrap().send_reply(env);
Ok(())
}
}
#[::async_trait::async_trait]
impl<P, H, R, RS> crate::fbthrift::ServiceProcessor<P> for GraphServiceProcessor<P, H, R, RS>
where
P: crate::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
P::Deserializer: ::std::marker::Send,
H: GraphService,
P::Frame: ::std::marker::Send + 'static,
R: crate::fbthrift::RequestContext<Name = ::std::ffi::CStr>
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'static,
<R as crate::fbthrift::RequestContext>::ContextStack: crate::fbthrift::ContextStack<
Name = R::Name,
Buffer = crate::fbthrift::ProtocolDecoded<P>,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'static,
RS: crate::fbthrift::ReplyState<P::Frame, RequestContext = R>
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'static,
{
type RequestContext = R;
type ReplyState = RS;
#[inline]
fn method_idx(
&self,
name: &[::std::primitive::u8],
) -> ::std::result::Result<::std::primitive::usize, crate::fbthrift::ApplicationException>
{
match name {
b"authenticate" => ::std::result::Result::Ok(0usize),
b"signout" => ::std::result::Result::Ok(1usize),
b"execute" => ::std::result::Result::Ok(2usize),
b"executeWithParameter" => ::std::result::Result::Ok(3usize),
b"executeJson" => ::std::result::Result::Ok(4usize),
b"executeJsonWithParameter" => ::std::result::Result::Ok(5usize),
b"verifyClientVersion" => ::std::result::Result::Ok(6usize),
_ => ::std::result::Result::Err(
crate::fbthrift::ApplicationException::unknown_method(),
),
}
}
#[allow(clippy::match_single_binding)]
async fn handle_method(
&self,
idx: ::std::primitive::usize,
_p: &mut P::Deserializer,
_r: &R,
_reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
_seqid: ::std::primitive::u32,
) -> ::anyhow::Result<()> {
match idx {
0usize => self.handle_authenticate(_p, _r, _reply_state, _seqid).await,
1usize => self.handle_signout(_p, _r, _reply_state, _seqid).await,
2usize => self.handle_execute(_p, _r, _reply_state, _seqid).await,
3usize => {
self.handle_executeWithParameter(_p, _r, _reply_state, _seqid)
.await
}
4usize => self.handle_executeJson(_p, _r, _reply_state, _seqid).await,
5usize => {
self.handle_executeJsonWithParameter(_p, _r, _reply_state, _seqid)
.await
}
6usize => {
self.handle_verifyClientVersion(_p, _r, _reply_state, _seqid)
.await
}
bad => panic!("{}: unexpected method idx {}", "GraphServiceProcessor", bad),
}
}
#[allow(clippy::match_single_binding)]
#[inline]
fn create_interaction_idx(&self, name: &str) -> ::anyhow::Result<::std::primitive::usize> {
match name {
_ => ::anyhow::bail!("Unknown interaction"),
}
}
#[allow(clippy::match_single_binding)]
fn handle_create_interaction(
&self,
idx: ::std::primitive::usize,
) -> ::anyhow::Result<
::std::sync::Arc<
dyn crate::fbthrift::ThriftService<
P::Frame,
Handler = (),
RequestContext = Self::RequestContext,
ReplyState = Self::ReplyState,
> + ::std::marker::Send
+ 'static,
>,
> {
match idx {
bad => panic!("{}: unexpected method idx {}", "GraphServiceProcessor", bad),
}
}
}
#[::async_trait::async_trait]
impl<P, H, R, RS> crate::fbthrift::ThriftService<P::Frame> for GraphServiceProcessor<P, H, R, RS>
where
P: crate::fbthrift::Protocol + ::std::marker::Send + ::std::marker::Sync + 'static,
P::Deserializer: ::std::marker::Send,
P::Frame: ::std::marker::Send + 'static,
H: GraphService,
R: crate::fbthrift::RequestContext<Name = ::std::ffi::CStr>
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'static,
<R as crate::fbthrift::RequestContext>::ContextStack: crate::fbthrift::ContextStack<
Name = R::Name,
Buffer = crate::fbthrift::ProtocolDecoded<P>,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'static,
RS: crate::fbthrift::ReplyState<P::Frame, RequestContext = R>
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'static,
{
type Handler = H;
type RequestContext = R;
type ReplyState = RS;
#[tracing::instrument(level = "trace", skip_all, fields(service = "GraphService"))]
async fn call(
&self,
req: crate::fbthrift::ProtocolDecoded<P>,
req_ctxt: &R,
reply_state: ::std::sync::Arc<::std::sync::Mutex<RS>>,
) -> ::anyhow::Result<()> {
use crate::fbthrift::{BufExt as _, ProtocolReader as _, ServiceProcessor as _};
let mut p = P::deserializer(req);
let (idx, mty, seqid) = p.read_message_begin(|name| self.method_idx(name))?;
if mty != crate::fbthrift::MessageType::Call {
return ::std::result::Result::Err(::std::convert::From::from(
crate::fbthrift::ApplicationException::new(
crate::fbthrift::ApplicationExceptionErrorCode::InvalidMessageType,
format!("message type {:?} not handled", mty),
),
));
}
let idx = match idx {
::std::result::Result::Ok(idx) => idx,
::std::result::Result::Err(_) => {
let cur = P::into_buffer(p).reset();
return self.supa.call(cur, req_ctxt, reply_state).await;
}
};
self.handle_method(idx, &mut p, req_ctxt, reply_state, seqid)
.await?;
p.read_message_end()?;
Ok(())
}
fn create_interaction(
&self,
name: &str,
) -> ::anyhow::Result<
::std::sync::Arc<
dyn crate::fbthrift::ThriftService<
P::Frame,
Handler = (),
RequestContext = R,
ReplyState = RS,
> + ::std::marker::Send
+ 'static,
>,
> {
use crate::fbthrift::ServiceProcessor as _;
let idx = self.create_interaction_idx(name);
let idx = match idx {
::anyhow::Result::Ok(idx) => idx,
::anyhow::Result::Err(_) => {
return self.supa.create_interaction(name);
}
};
self.handle_create_interaction(idx)
}
fn get_method_names(&self) -> &'static [&'static str] {
&[
"authenticate",
"signout",
"execute",
"executeWithParameter",
"executeJson",
"executeJsonWithParameter",
"verifyClientVersion",
]
}
}
#[::tracing::instrument(level="debug", skip_all, fields(proto = ?proto))]
pub fn make_GraphService_server<F, H, R, RS>(
proto: crate::fbthrift::ProtocolID,
handler: H,
) -> ::std::result::Result<
::std::boxed::Box<
dyn crate::fbthrift::ThriftService<F, Handler = H, RequestContext = R, ReplyState = RS>
+ ::std::marker::Send
+ 'static,
>,
crate::fbthrift::ApplicationException,
>
where
F: crate::fbthrift::Framing + ::std::marker::Send + ::std::marker::Sync + 'static,
H: GraphService,
R: crate::fbthrift::RequestContext<Name = ::std::ffi::CStr>
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'static,
<R as crate::fbthrift::RequestContext>::ContextStack: crate::fbthrift::ContextStack<Name = R::Name, Buffer = F::DecBuf>
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'static,
RS: crate::fbthrift::ReplyState<F, RequestContext = R>
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'static,
{
match proto {
crate::fbthrift::ProtocolID::BinaryProtocol => {
::std::result::Result::Ok(::std::boxed::Box::new(GraphServiceProcessor::<
crate::fbthrift::BinaryProtocol<F>,
H,
R,
RS,
>::new(handler)))
}
crate::fbthrift::ProtocolID::CompactProtocol => {
::std::result::Result::Ok(::std::boxed::Box::new(GraphServiceProcessor::<
crate::fbthrift::CompactProtocol<F>,
H,
R,
RS,
>::new(handler)))
}
bad => {
::tracing::error!(method = "GraphService.", invalid_protocol = ?bad);
::std::result::Result::Err(crate::fbthrift::ApplicationException::invalid_protocol(
bad,
))
}
}
}
}
pub mod mock {
use crate::fbthrift_protocol::common;
pub struct GraphService<'mock> {
pub authenticate: r#impl::graph_service::authenticate<'mock>,
pub signout: r#impl::graph_service::signout<'mock>,
pub execute: r#impl::graph_service::execute<'mock>,
pub executeWithParameter: r#impl::graph_service::executeWithParameter<'mock>,
pub executeJson: r#impl::graph_service::executeJson<'mock>,
pub executeJsonWithParameter: r#impl::graph_service::executeJsonWithParameter<'mock>,
pub verifyClientVersion: r#impl::graph_service::verifyClientVersion<'mock>,
_marker: ::std::marker::PhantomData<&'mock ()>,
}
impl dyn super::client::GraphService {
pub fn mock<'mock>() -> GraphService<'mock> {
GraphService {
authenticate: r#impl::graph_service::authenticate::unimplemented(),
signout: r#impl::graph_service::signout::unimplemented(),
execute: r#impl::graph_service::execute::unimplemented(),
executeWithParameter: r#impl::graph_service::executeWithParameter::unimplemented(),
executeJson: r#impl::graph_service::executeJson::unimplemented(),
executeJsonWithParameter:
r#impl::graph_service::executeJsonWithParameter::unimplemented(),
verifyClientVersion: r#impl::graph_service::verifyClientVersion::unimplemented(),
_marker: ::std::marker::PhantomData,
}
}
}
impl<'mock> super::client::GraphService for GraphService<'mock> {
fn authenticate(
&self,
arg_username: &::std::vec::Vec<::std::primitive::u8>,
arg_password: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
>,
> {
let mut closure = self.authenticate.closure.lock().unwrap();
let closure: &mut dyn ::std::ops::FnMut(
::std::vec::Vec<::std::primitive::u8>,
::std::vec::Vec<::std::primitive::u8>,
) -> _ = &mut **closure;
::std::boxed::Box::pin(::futures::future::ready(closure(
arg_username.clone(),
arg_password.clone(),
)))
}
fn signout(
&self,
arg_sessionId: ::std::primitive::i64,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
(),
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
>,
> {
let mut closure = self.signout.closure.lock().unwrap();
let closure: &mut dyn ::std::ops::FnMut(::std::primitive::i64) -> _ = &mut **closure;
::std::boxed::Box::pin(::futures::future::ready(closure(arg_sessionId.clone())))
}
fn execute(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
>,
> {
let mut closure = self.execute.closure.lock().unwrap();
let closure: &mut dyn ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
) -> _ = &mut **closure;
::std::boxed::Box::pin(::futures::future::ready(closure(
arg_sessionId.clone(),
arg_stmt.clone(),
)))
}
fn executeWithParameter(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
>,
> {
let mut closure = self.executeWithParameter.closure.lock().unwrap();
let closure: &mut dyn ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> _ = &mut **closure;
::std::boxed::Box::pin(::futures::future::ready(closure(
arg_sessionId.clone(),
arg_stmt.clone(),
arg_parameterMap.clone(),
)))
}
fn executeJson(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
>,
> {
let mut closure = self.executeJson.closure.lock().unwrap();
let closure: &mut dyn ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
) -> _ = &mut **closure;
::std::boxed::Box::pin(::futures::future::ready(closure(
arg_sessionId.clone(),
arg_stmt.clone(),
)))
}
fn executeJsonWithParameter(
&self,
arg_sessionId: ::std::primitive::i64,
arg_stmt: &::std::vec::Vec<::std::primitive::u8>,
arg_parameterMap: &::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError,
>,
>{
let mut closure = self.executeJsonWithParameter.closure.lock().unwrap();
let closure: &mut dyn ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> _ = &mut **closure;
::std::boxed::Box::pin(::futures::future::ready(closure(
arg_sessionId.clone(),
arg_stmt.clone(),
arg_parameterMap.clone(),
)))
}
fn verifyClientVersion(
&self,
arg_req: &crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
) -> ::futures::future::BoxFuture<
'static,
::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
>,
> {
let mut closure = self.verifyClientVersion.closure.lock().unwrap();
let closure: &mut dyn ::std::ops::FnMut(
crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
) -> _ = &mut **closure;
::std::boxed::Box::pin(::futures::future::ready(closure(arg_req.clone())))
}
}
mod r#impl {
pub mod graph_service {
use crate::fbthrift_protocol::common;
pub struct authenticate<'mock> {
pub(crate) closure: ::std::sync::Mutex<
::std::boxed::Box<
dyn ::std::ops::FnMut(
::std::vec::Vec<::std::primitive::u8>,
::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
>,
>,
}
#[allow(clippy::redundant_closure)]
impl<'mock> authenticate<'mock> {
pub fn unimplemented() -> Self {
Self {
closure: ::std::sync::Mutex::new(::std::boxed::Box::new(
|_: ::std::vec::Vec<::std::primitive::u8>,
_: ::std::vec::Vec<::std::primitive::u8>| {
panic!("{}::{} is not mocked", "GraphService", "authenticate",)
},
)),
}
}
pub fn ret(&self, value: crate::fbthrift_protocol::graph::types::AuthResponse) {
self.mock(
move |_: ::std::vec::Vec<::std::primitive::u8>,
_: ::std::vec::Vec<::std::primitive::u8>| {
value.clone()
},
);
}
pub fn mock(
&self,
mut mock: impl ::std::ops::FnMut(
::std::vec::Vec<::std::primitive::u8>,
::std::vec::Vec<::std::primitive::u8>,
) -> crate::fbthrift_protocol::graph::types::AuthResponse
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |username, password| {
::std::result::Result::Ok(mock(username, password))
});
}
pub fn mock_result(
&self,
mut mock: impl ::std::ops::FnMut(
::std::vec::Vec<::std::primitive::u8>,
::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure =
::std::boxed::Box::new(move |username, password| mock(username, password));
}
pub fn throw<E>(&self, exception: E)
where
E: ::std::convert::Into<
crate::fbthrift_protocol::graph::errors::graph_service::AuthenticateError,
>,
E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
{
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(
move |_: ::std::vec::Vec<::std::primitive::u8>,
_: ::std::vec::Vec<::std::primitive::u8>| {
::std::result::Result::Err(exception.clone().into())
},
);
}
}
pub struct signout<'mock> {
pub(crate) closure: ::std::sync::Mutex<
::std::boxed::Box<
dyn ::std::ops::FnMut(
::std::primitive::i64,
) -> ::std::result::Result<
(),
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
>,
>,
}
#[allow(clippy::redundant_closure)]
impl<'mock> signout<'mock> {
pub fn unimplemented() -> Self {
Self {
closure: ::std::sync::Mutex::new(::std::boxed::Box::new(
|_: ::std::primitive::i64| {
panic!("{}::{} is not mocked", "GraphService", "signout",)
},
)),
}
}
pub fn ret(&self, value: ()) {
self.mock(move |_: ::std::primitive::i64| value.clone());
}
pub fn mock(
&self,
mut mock: impl ::std::ops::FnMut(::std::primitive::i64) -> ()
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |sessionId| {
::std::result::Result::Ok(mock(sessionId))
});
}
pub fn mock_result(
&self,
mut mock: impl ::std::ops::FnMut(
::std::primitive::i64,
) -> ::std::result::Result<
(),
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |sessionId| mock(sessionId));
}
pub fn throw<E>(&self, exception: E)
where
E: ::std::convert::Into<
crate::fbthrift_protocol::graph::errors::graph_service::SignoutError,
>,
E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
{
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |_: ::std::primitive::i64| {
::std::result::Result::Err(exception.clone().into())
});
}
}
pub struct execute<'mock> {
pub(crate) closure: ::std::sync::Mutex<
::std::boxed::Box<
dyn ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
>,
>,
}
#[allow(clippy::redundant_closure)]
impl<'mock> execute<'mock> {
pub fn unimplemented() -> Self {
Self {
closure: ::std::sync::Mutex::new(::std::boxed::Box::new(
|_: ::std::primitive::i64, _: ::std::vec::Vec<::std::primitive::u8>| {
panic!("{}::{} is not mocked", "GraphService", "execute",)
},
)),
}
}
pub fn ret(
&self,
value: crate::fbthrift_protocol::graph::types::ExecutionResponse,
) {
self.mock(
move |_: ::std::primitive::i64,
_: ::std::vec::Vec<::std::primitive::u8>| {
value.clone()
},
);
}
pub fn mock(
&self,
mut mock: impl ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
) -> crate::fbthrift_protocol::graph::types::ExecutionResponse
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |sessionId, stmt| {
::std::result::Result::Ok(mock(sessionId, stmt))
});
}
pub fn mock_result(
&self,
mut mock: impl ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |sessionId, stmt| mock(sessionId, stmt));
}
pub fn throw<E>(&self, exception: E)
where
E: ::std::convert::Into<
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteError,
>,
E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
{
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(
move |_: ::std::primitive::i64,
_: ::std::vec::Vec<::std::primitive::u8>| {
::std::result::Result::Err(exception.clone().into())
},
);
}
}
pub struct executeWithParameter<'mock> {
pub(crate) closure: ::std::sync::Mutex<
::std::boxed::Box<
dyn ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
>,
>,
}
#[allow(clippy::redundant_closure)]
impl<'mock> executeWithParameter<'mock> {
pub fn unimplemented() -> Self {
Self {
closure: ::std::sync::Mutex::new(::std::boxed::Box::new(
|_: ::std::primitive::i64,
_: ::std::vec::Vec<::std::primitive::u8>,
_: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>| {
panic!(
"{}::{} is not mocked",
"GraphService", "executeWithParameter",
)
},
)),
}
}
pub fn ret(
&self,
value: crate::fbthrift_protocol::graph::types::ExecutionResponse,
) {
self.mock(
move |_: ::std::primitive::i64,
_: ::std::vec::Vec<::std::primitive::u8>,
_: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>| value.clone(),
);
}
pub fn mock(
&self,
mut mock: impl ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> crate::fbthrift_protocol::graph::types::ExecutionResponse
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |sessionId, stmt, parameterMap| {
::std::result::Result::Ok(mock(sessionId, stmt, parameterMap))
});
}
pub fn mock_result(
&self,
mut mock: impl ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |sessionId, stmt, parameterMap| {
mock(sessionId, stmt, parameterMap)
});
}
pub fn throw<E>(&self, exception: E)
where
E: ::std::convert::Into<crate::fbthrift_protocol::graph::errors::graph_service::ExecuteWithParameterError>,
E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
{
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(
move |_: ::std::primitive::i64,
_: ::std::vec::Vec<::std::primitive::u8>,
_: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>| {
::std::result::Result::Err(exception.clone().into())
},
);
}
}
pub struct executeJson<'mock> {
pub(crate) closure: ::std::sync::Mutex<
::std::boxed::Box<
dyn ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
>,
>,
}
#[allow(clippy::redundant_closure)]
impl<'mock> executeJson<'mock> {
pub fn unimplemented() -> Self {
Self {
closure: ::std::sync::Mutex::new(::std::boxed::Box::new(
|_: ::std::primitive::i64, _: ::std::vec::Vec<::std::primitive::u8>| {
panic!("{}::{} is not mocked", "GraphService", "executeJson",)
},
)),
}
}
pub fn ret(&self, value: ::std::vec::Vec<::std::primitive::u8>) {
self.mock(
move |_: ::std::primitive::i64,
_: ::std::vec::Vec<::std::primitive::u8>| {
value.clone()
},
);
}
pub fn mock(
&self,
mut mock: impl ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
)
-> ::std::vec::Vec<::std::primitive::u8>
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |sessionId, stmt| {
::std::result::Result::Ok(mock(sessionId, stmt))
});
}
pub fn mock_result(
&self,
mut mock: impl ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
) -> ::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |sessionId, stmt| mock(sessionId, stmt));
}
pub fn throw<E>(&self, exception: E)
where
E: ::std::convert::Into<
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonError,
>,
E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
{
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(
move |_: ::std::primitive::i64,
_: ::std::vec::Vec<::std::primitive::u8>| {
::std::result::Result::Err(exception.clone().into())
},
);
}
}
pub struct executeJsonWithParameter<'mock> {
pub(crate) closure: ::std::sync::Mutex<
::std::boxed::Box<
dyn ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
>,
>,
}
#[allow(clippy::redundant_closure)]
impl<'mock> executeJsonWithParameter<'mock> {
pub fn unimplemented() -> Self {
Self {
closure: ::std::sync::Mutex::new(::std::boxed::Box::new(
|_: ::std::primitive::i64,
_: ::std::vec::Vec<::std::primitive::u8>,
_: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>| {
panic!(
"{}::{} is not mocked",
"GraphService", "executeJsonWithParameter",
)
},
)),
}
}
pub fn ret(&self, value: ::std::vec::Vec<::std::primitive::u8>) {
self.mock(
move |_: ::std::primitive::i64,
_: ::std::vec::Vec<::std::primitive::u8>,
_: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>| value.clone(),
);
}
pub fn mock(
&self,
mut mock: impl ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
)
-> ::std::vec::Vec<::std::primitive::u8>
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |sessionId, stmt, parameterMap| {
::std::result::Result::Ok(mock(sessionId, stmt, parameterMap))
});
}
pub fn mock_result(
&self,
mut mock: impl ::std::ops::FnMut(
::std::primitive::i64,
::std::vec::Vec<::std::primitive::u8>,
::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>,
) -> ::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |sessionId, stmt, parameterMap| {
mock(sessionId, stmt, parameterMap)
});
}
pub fn throw<E>(&self, exception: E)
where
E: ::std::convert::Into<crate::fbthrift_protocol::graph::errors::graph_service::ExecuteJsonWithParameterError>,
E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
{
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(
move |_: ::std::primitive::i64,
_: ::std::vec::Vec<::std::primitive::u8>,
_: ::std::collections::BTreeMap<
::std::vec::Vec<::std::primitive::u8>,
common::types::Value,
>| {
::std::result::Result::Err(exception.clone().into())
},
);
}
}
pub struct verifyClientVersion<'mock> {
pub(crate) closure: ::std::sync::Mutex<
::std::boxed::Box<
dyn ::std::ops::FnMut(
crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
>,
>,
}
#[allow(clippy::redundant_closure)]
impl<'mock> verifyClientVersion<'mock> {
pub fn unimplemented() -> Self {
Self {
closure: ::std::sync::Mutex::new(::std::boxed::Box::new(
|_: crate::fbthrift_protocol::graph::types::VerifyClientVersionReq| {
panic!(
"{}::{} is not mocked",
"GraphService", "verifyClientVersion",
)
},
)),
}
}
pub fn ret(
&self,
value: crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
) {
self.mock(
move |_: crate::fbthrift_protocol::graph::types::VerifyClientVersionReq| {
value.clone()
},
);
}
pub fn mock(
&self,
mut mock: impl ::std::ops::FnMut(
crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
) -> crate::fbthrift_protocol::graph::types::VerifyClientVersionResp
+ ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure =
::std::boxed::Box::new(move |req| ::std::result::Result::Ok(mock(req)));
}
pub fn mock_result(
&self,
mut mock: impl ::std::ops::FnMut(
crate::fbthrift_protocol::graph::types::VerifyClientVersionReq,
) -> ::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError,
> + ::std::marker::Send
+ ::std::marker::Sync
+ 'mock,
) {
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(move |req| mock(req));
}
pub fn throw<E>(&self, exception: E)
where
E: ::std::convert::Into<crate::fbthrift_protocol::graph::errors::graph_service::VerifyClientVersionError>,
E: ::std::clone::Clone + ::std::marker::Send + ::std::marker::Sync + 'mock,
{
let mut closure = self.closure.lock().unwrap();
*closure = ::std::boxed::Box::new(
move |_: crate::fbthrift_protocol::graph::types::VerifyClientVersionReq| {
::std::result::Result::Err(exception.clone().into())
},
);
}
}
}
}
}
pub mod errors {
use super::*;
pub mod graph_service {
pub type AuthenticateError = crate::fbthrift::NonthrowingFunctionError;
impl ::std::convert::From<super::services::graph_service::AuthenticateExn>
for ::std::result::Result<
crate::fbthrift_protocol::graph::types::AuthResponse,
AuthenticateError,
>
{
fn from(e: super::services::graph_service::AuthenticateExn) -> Self {
match e {
super::services::graph_service::AuthenticateExn::Success(res) => {
::std::result::Result::Ok(res)
}
super::services::graph_service::AuthenticateExn::ApplicationException(aexn) => {
::std::result::Result::Err(AuthenticateError::ApplicationException(aexn))
}
}
}
}
pub type SignoutError = crate::fbthrift::NonthrowingFunctionError;
impl ::std::convert::From<super::services::graph_service::SignoutExn>
for ::std::result::Result<(), SignoutError>
{
fn from(e: super::services::graph_service::SignoutExn) -> Self {
match e {
super::services::graph_service::SignoutExn::Success(res) => {
::std::result::Result::Ok(res)
}
super::services::graph_service::SignoutExn::ApplicationException(aexn) => {
::std::result::Result::Err(SignoutError::ApplicationException(aexn))
}
}
}
}
pub type ExecuteError = crate::fbthrift::NonthrowingFunctionError;
impl ::std::convert::From<super::services::graph_service::ExecuteExn>
for ::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
ExecuteError,
>
{
fn from(e: super::services::graph_service::ExecuteExn) -> Self {
match e {
super::services::graph_service::ExecuteExn::Success(res) => {
::std::result::Result::Ok(res)
}
super::services::graph_service::ExecuteExn::ApplicationException(aexn) => {
::std::result::Result::Err(ExecuteError::ApplicationException(aexn))
}
}
}
}
pub type ExecuteWithParameterError = crate::fbthrift::NonthrowingFunctionError;
impl ::std::convert::From<super::services::graph_service::ExecuteWithParameterExn>
for ::std::result::Result<
crate::fbthrift_protocol::graph::types::ExecutionResponse,
ExecuteWithParameterError,
>
{
fn from(e: super::services::graph_service::ExecuteWithParameterExn) -> Self {
match e {
super::services::graph_service::ExecuteWithParameterExn::Success(res) => {
::std::result::Result::Ok(res)
}
super::services::graph_service::ExecuteWithParameterExn::ApplicationException(aexn) =>
::std::result::Result::Err(ExecuteWithParameterError::ApplicationException(aexn)),
}
}
}
pub type ExecuteJsonError = crate::fbthrift::NonthrowingFunctionError;
impl ::std::convert::From<super::services::graph_service::ExecuteJsonExn>
for ::std::result::Result<::std::vec::Vec<::std::primitive::u8>, ExecuteJsonError>
{
fn from(e: super::services::graph_service::ExecuteJsonExn) -> Self {
match e {
super::services::graph_service::ExecuteJsonExn::Success(res) => {
::std::result::Result::Ok(res)
}
super::services::graph_service::ExecuteJsonExn::ApplicationException(aexn) => {
::std::result::Result::Err(ExecuteJsonError::ApplicationException(aexn))
}
}
}
}
pub type ExecuteJsonWithParameterError = crate::fbthrift::NonthrowingFunctionError;
impl ::std::convert::From<super::services::graph_service::ExecuteJsonWithParameterExn>
for ::std::result::Result<
::std::vec::Vec<::std::primitive::u8>,
ExecuteJsonWithParameterError,
>
{
fn from(e: super::services::graph_service::ExecuteJsonWithParameterExn) -> Self {
match e {
super::services::graph_service::ExecuteJsonWithParameterExn::Success(res) => {
::std::result::Result::Ok(res)
}
super::services::graph_service::ExecuteJsonWithParameterExn::ApplicationException(aexn) =>
::std::result::Result::Err(ExecuteJsonWithParameterError::ApplicationException(aexn)),
}
}
}
pub type VerifyClientVersionError = crate::fbthrift::NonthrowingFunctionError;
impl ::std::convert::From<super::services::graph_service::VerifyClientVersionExn>
for ::std::result::Result<
crate::fbthrift_protocol::graph::types::VerifyClientVersionResp,
VerifyClientVersionError,
>
{
fn from(e: super::services::graph_service::VerifyClientVersionExn) -> Self {
match e {
super::services::graph_service::VerifyClientVersionExn::Success(res) => {
::std::result::Result::Ok(res)
}
super::services::graph_service::VerifyClientVersionExn::ApplicationException(aexn) =>
::std::result::Result::Err(VerifyClientVersionError::ApplicationException(aexn)),
}
}
}
}
}