<commit_before>{{!

  Copyright (c) Facebook, Inc. and its affiliates.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

}}// @{{}}generated by Thrift. {{!
}}This file is probably not the place you want to edit!

#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies)]

{{#program:constants?}}
pub use self::consts::*;
{{/program:constants?}}
pub use self::errors::*;{{!
}}{{#program:types?}}
pub use self::types::*;{{!
}}{{/program:types?}}{{!
}}{{#program:constants?}}

pub mod consts {{>lib/block}}{{>lib/mod.consts}}}{{!
}}{{/program:constants?}}{{!
}}{{#program:types?}}

pub mod types {{>lib/block}}{{>lib/mod.types}}}{{!
}}{{/program:types?}}{{!
}}{{#program:services?}}

pub mod dependencies {{>lib/block}}{{>lib/mod.dependencies}}}

pub mod services {{>lib/block}}{{>lib/mod.services}}}

pub mod client {{>lib/block}}{{>lib/mod.client}}}

pub mod server {{>lib/block}}{{>lib/mod.server}}}

/// Client mocks. For every service, a struct mock::TheService that implements
/// client::TheService.
///
/// As an example of the generated API, for the following thrift service:
///
///     service MyService {
///         FunctionResponse myFunction(
///             1: FunctionRequest request,
///         ) throws {
///             1: StorageException s,
///             2: NotFoundException n,
///         ),
///
///         // other functions
///     }
///
///
/// we would end up with this mock object under crate::mock::MyService:
///
///     impl crate::client::MyService for MyService<'mock> {...}
///
///     pub struct MyService<'mock> {
///         pub myFunction: myFunction<'mock>,
///         // ...
///     }
///
///     impl dyn crate::client::MyService {
///         pub fn mock<'mock>() -> MyService<'mock>;
///     }
///
///     impl myFunction<'mock> {
///         // directly return the given success response
///         pub fn ret(&self, value: FunctionResponse);
///
///         // invoke closure to compute success response
///         pub fn mock(
///             &self,
///             mock: impl FnMut(FunctionRequest) -> FunctionResponse + Send + Sync + 'mock,
///         );
///
///         // return one of the function's declared exceptions
///         pub fn throw<E>(&self, exception: E)
///         where
///             E: Clone + Into<crate::services::MyService::MyFunctionExn> + Send + Sync + 'mock;
///     }
///
///     impl From<StorageException> for MyFunctionExn {...}
///     impl From<NotFoundException> for MyFunctionExn {...}
///
///
/// The intended usage from a test would be:
///
///     use std::sync::Arc;
///     use thrift_if::client::MyService;
///
///     #[test]
///     fn test_my_client() {
///         let mock = Arc::new(MyService::mock());
///
///         // directly return a success response
///         let resp = FunctionResponse {...};
///         mock.myFunction.ret(resp);
///
///         // or give a closure to compute the success response
///         mock.myFunction.mock(|request| FunctionResponse {...});
///
///         // or throw one of the function's exceptions
///         mock.myFunction.throw(StorageException::ItFailed);
///
///         let out = do_the_thing(mock).wait().unwrap();
///         assert!(out.what_i_expected());
///     }
///
///     fn do_the_thing(
///         client: Arc<dyn MyService + Send + Sync + 'static>,
///     ) -> impl Future<Item = Out> {...}
pub mod mock {{>lib/block}}{{>lib/mod.mock}}}{{!
}}{{/program:services?}}

pub mod errors {{>lib/block}}{{>lib/mod.errors}}}{{!

}}{{#program:nonstandardCollections?}}

mod r#impl {{>lib/block}}{{>lib/mod.impl}}}{{!
}}{{/program:nonstandardCollections?}}
<commit_msg>Work around Rust error message bug<commit_after>{{!

  Copyright (c) Facebook, Inc. and its affiliates.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

}}// @{{}}generated by Thrift. {{!
}}This file is probably not the place you want to edit!

#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused_crate_dependencies)]

{{#program:serde?}}
{{! work around https://github.com/rust-lang/rust/issues/46991 }}
extern crate serde;
{{/program:serde?}}
{{#program:constants?}}
pub use self::consts::*;
{{/program:constants?}}
pub use self::errors::*;{{!
}}{{#program:types?}}
pub use self::types::*;{{!
}}{{/program:types?}}{{!
}}{{#program:constants?}}

pub mod consts {{>lib/block}}{{>lib/mod.consts}}}{{!
}}{{/program:constants?}}{{!
}}{{#program:types?}}

pub mod types {{>lib/block}}{{>lib/mod.types}}}{{!
}}{{/program:types?}}{{!
}}{{#program:services?}}

pub mod dependencies {{>lib/block}}{{>lib/mod.dependencies}}}

pub mod services {{>lib/block}}{{>lib/mod.services}}}

pub mod client {{>lib/block}}{{>lib/mod.client}}}

pub mod server {{>lib/block}}{{>lib/mod.server}}}

/// Client mocks. For every service, a struct mock::TheService that implements
/// client::TheService.
///
/// As an example of the generated API, for the following thrift service:
///
///     service MyService {
///         FunctionResponse myFunction(
///             1: FunctionRequest request,
///         ) throws {
///             1: StorageException s,
///             2: NotFoundException n,
///         ),
///
///         // other functions
///     }
///
///
/// we would end up with this mock object under crate::mock::MyService:
///
///     impl crate::client::MyService for MyService<'mock> {...}
///
///     pub struct MyService<'mock> {
///         pub myFunction: myFunction<'mock>,
///         // ...
///     }
///
///     impl dyn crate::client::MyService {
///         pub fn mock<'mock>() -> MyService<'mock>;
///     }
///
///     impl myFunction<'mock> {
///         // directly return the given success response
///         pub fn ret(&self, value: FunctionResponse);
///
///         // invoke closure to compute success response
///         pub fn mock(
///             &self,
///             mock: impl FnMut(FunctionRequest) -> FunctionResponse + Send + Sync + 'mock,
///         );
///
///         // return one of the function's declared exceptions
///         pub fn throw<E>(&self, exception: E)
///         where
///             E: Clone + Into<crate::services::MyService::MyFunctionExn> + Send + Sync + 'mock;
///     }
///
///     impl From<StorageException> for MyFunctionExn {...}
///     impl From<NotFoundException> for MyFunctionExn {...}
///
///
/// The intended usage from a test would be:
///
///     use std::sync::Arc;
///     use thrift_if::client::MyService;
///
///     #[test]
///     fn test_my_client() {
///         let mock = Arc::new(MyService::mock());
///
///         // directly return a success response
///         let resp = FunctionResponse {...};
///         mock.myFunction.ret(resp);
///
///         // or give a closure to compute the success response
///         mock.myFunction.mock(|request| FunctionResponse {...});
///
///         // or throw one of the function's exceptions
///         mock.myFunction.throw(StorageException::ItFailed);
///
///         let out = do_the_thing(mock).wait().unwrap();
///         assert!(out.what_i_expected());
///     }
///
///     fn do_the_thing(
///         client: Arc<dyn MyService + Send + Sync + 'static>,
///     ) -> impl Future<Item = Out> {...}
pub mod mock {{>lib/block}}{{>lib/mod.mock}}}{{!
}}{{/program:services?}}

pub mod errors {{>lib/block}}{{>lib/mod.errors}}}{{!

}}{{#program:nonstandardCollections?}}

mod r#impl {{>lib/block}}{{>lib/mod.impl}}}{{!
}}{{/program:nonstandardCollections?}}

{'fraction_non_alphanumeric': 0.19518243003896563, 'fraction_numerical': 0.0022434762073444327, 'mean_word_length': 2.5189031990029083, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 69, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7246127', 'n_tokens_mistral': 2513, 'n_tokens_neox': 2513, 'n_words': 701}