1 // Licensed to the Apache Software Foundation (ASF) under one 2 // or more contributor license agreements. See the NOTICE file 3 // distributed with this work for additional information 4 // regarding copyright ownership. The ASF licenses this file 5 // to you under the Apache License, Version 2.0 (the 6 // "License"); you may not use this file except in compliance 7 // with the License. You may obtain a copy of the License at 8 // 9 // http://www.apache.org/licenses/LICENSE-2.0 10 // 11 // Unless required by applicable law or agreed to in writing, 12 // software distributed under the License is distributed on an 13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 // KIND, either express or implied. See the License for the 15 // specific language governing permissions and limitations 16 // under the License. 17 18 //! Thrift compiler auto-generated support. 19 //! 20 //! 21 //! Types and functions used internally by the Thrift compiler's Rust plugin 22 //! to implement required functionality. Users should never have to use code 23 //! in this module directly. 24 25 use crate::protocol::{TInputProtocol, TOutputProtocol}; 26 27 /// Specifies the minimum functionality an auto-generated client should provide 28 /// to communicate with a Thrift server. 29 pub trait TThriftClient { 30 /// Returns the input protocol used to read serialized Thrift messages 31 /// from the Thrift server. i_prot_mut(&mut self) -> &mut dyn TInputProtocol32 fn i_prot_mut(&mut self) -> &mut dyn TInputProtocol; 33 /// Returns the output protocol used to write serialized Thrift messages 34 /// to the Thrift server. o_prot_mut(&mut self) -> &mut dyn TOutputProtocol35 fn o_prot_mut(&mut self) -> &mut dyn TOutputProtocol; 36 /// Returns the sequence number of the last message written to the Thrift 37 /// server. Returns `0` if no messages have been written. Sequence 38 /// numbers should *never* be negative, and this method returns an `i32` 39 /// simply because the Thrift protocol encodes sequence numbers as `i32` on 40 /// the wire. sequence_number(&self) -> i3241 fn sequence_number(&self) -> i32; // FIXME: consider returning a u32 42 /// Increments the sequence number, indicating that a message with that 43 /// number has been sent to the Thrift server. increment_sequence_number(&mut self) -> i3244 fn increment_sequence_number(&mut self) -> i32; 45 } 46