• Home
  • Raw
  • Download

Lines Matching refs:GrpcSlice

19 pub struct GrpcSlice(grpc_slice);  struct
21 impl GrpcSlice { implementation
55 pub fn from_static_slice(s: &'static [u8]) -> GrpcSlice { in from_static_slice() argument
56 GrpcSlice(unsafe { grpc_slice_from_static_buffer(s.as_ptr() as _, s.len()) }) in from_static_slice()
63 pub fn from_static_str(s: &'static str) -> GrpcSlice { in from_static_str() argument
64 GrpcSlice::from_static_slice(s.as_bytes()) in from_static_str()
83 *self = GrpcSlice::default(); in realloc()
91 *self = GrpcSlice(grpcio_sys::grpc_slice_malloc_large(cap)); in realloc()
103 impl Clone for GrpcSlice { implementation
109 GrpcSlice(unsafe { grpc_slice_ref(self.0) }) in clone()
113 impl Default for GrpcSlice { implementation
116 GrpcSlice(unsafe { grpc_empty_slice() }) in default()
120 impl Debug for GrpcSlice { implementation
126 impl Drop for GrpcSlice { implementation
134 unsafe impl Send for GrpcSlice {} implementation
135 unsafe impl Sync for GrpcSlice {} implementation
137 impl PartialEq<[u8]> for GrpcSlice { implementation
145 impl PartialEq<GrpcSlice> for GrpcSlice { implementation
146 fn eq(&self, r: &GrpcSlice) -> bool { in eq()
155 impl From<Vec<u8>> for GrpcSlice { implementation
160 fn from(mut v: Vec<u8>) -> GrpcSlice { in from() argument
162 return GrpcSlice::default(); in from()
170 return GrpcSlice(slice); in from()
174 GrpcSlice(grpcio_sys::grpc_slice_from_copied_buffer( in from()
185 impl From<String> for GrpcSlice { implementation
187 fn from(s: String) -> GrpcSlice { in from() argument
188 GrpcSlice::from(s.into_bytes()) in from()
195 impl From<CString> for GrpcSlice { implementation
197 fn from(s: CString) -> GrpcSlice { in from() argument
198 GrpcSlice::from(s.into_bytes()) in from()
206 impl From<&'_ [u8]> for GrpcSlice { implementation
208 fn from(s: &'_ [u8]) -> GrpcSlice { in from() argument
209 GrpcSlice(unsafe { grpc_slice_from_copied_buffer(s.as_ptr() as _, s.len()) }) in from()
217 impl From<&'_ str> for GrpcSlice { implementation
219 fn from(s: &'_ str) -> GrpcSlice { in from() argument
220 GrpcSlice::from(s.as_bytes()) in from()
228 impl From<&'_ CStr> for GrpcSlice { implementation
230 fn from(s: &'_ CStr) -> GrpcSlice { in from() argument
231 GrpcSlice::from(s.to_bytes()) in from()
246 impl<'a> From<&'a [GrpcSlice]> for GrpcByteBuffer {
251 fn from(slice: &'a [GrpcSlice]) -> Self { in from()
261 impl<'a> From<&'a GrpcSlice> for GrpcByteBuffer {
266 fn from(s: &'a GrpcSlice) -> GrpcByteBuffer { in from()
273 let s = &*(s as *const GrpcSlice as *const grpc_slice as *const UnsafeCell<grpc_slice>); in from() constant
302 slice: ManuallyDrop<GrpcSlice>,
328 slice: ManuallyDrop::new(GrpcSlice(s.assume_init())), in new()
340 self.slice = ManuallyDrop::new(GrpcSlice::default()); in load_next_slice()
453 let data = vec![GrpcSlice::from(seed); copy_count]; in new_message_reader()
460 let empty = GrpcSlice::default(); in test_grpc_slice()
466 let slice = GrpcSlice::from(a.clone()); in test_grpc_slice()
472 let slice = GrpcSlice::from(a.clone()); in test_grpc_slice()
478 let slice = GrpcSlice::from(a); in test_grpc_slice()
488 let slice = GrpcSlice::from(data.clone()); in test_typo_len_offset()
571 assert_eq!(GrpcSlice::from(a.clone()).as_slice(), a.as_slice()); in test_converter()
572 assert_eq!(GrpcSlice::from(a.as_slice()).as_slice(), a.as_slice()); in test_converter()
575 assert_eq!(GrpcSlice::from(s.clone()).as_slice(), s.as_bytes()); in test_converter()
576 assert_eq!(GrpcSlice::from(s.as_str()).as_slice(), s.as_bytes()); in test_converter()
579 assert_eq!(GrpcSlice::from(cs.clone()).as_slice(), s.as_bytes()); in test_converter()
580 assert_eq!(GrpcSlice::from(cs.as_c_str()).as_slice(), s.as_bytes()); in test_converter()