### Use r2g_struct_tag Attribute Macro Source: https://docs.rs/rust2go/0.4.3/rust2go/attr.r2g_struct_tag.html Apply this attribute macro to structs to mark them for use with rust2go. No additional setup is required beyond applying the macro. ```rust #[r2g_struct_tag] ``` -------------------------------- ### Any Trait Implementation Source: https://docs.rs/rust2go/0.4.3/rust2go/enum.ResponseFuture.html Implements the Any trait for any type T that is 'static and ?Sized. Provides a method to get the TypeId of the trait object. ```rust fn type_id(&self) -> TypeId ``` -------------------------------- ### Macros and Attributes Source: https://docs.rs/rust2go/0.4.3/index.html Overview of the procedural and attribute macros provided by the crate. ```APIDOC ## Macros ### Attribute Macros - **g2r**: Attribute macro for Go to Rust bindings. - **r2g**: Attribute macro for Rust to Go bindings. - **r2g_struct_tag**: Used to mark structs for binding generation. ### Derive Macros - **R2G**: Derive macro to implement rust2go functionality for a struct. ``` -------------------------------- ### Get SlotWriter Pointer Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.SlotWriter.html The `into_ptr` method consumes the SlotWriter and returns a raw pointer to its internal data. Use with caution. ```rust pub fn into_ptr(self) -> *const () ``` -------------------------------- ### Macros Source: https://docs.rs/rust2go/0.4.3/rust2go Documentation for macros provided by the rust2go crate. ```APIDOC ## Macros ### `max_mem_type` *Description: [Description of max_mem_type macro]* ### `r2g_include_binding` *Description: [Description of r2g_include_binding macro]* ``` -------------------------------- ### Blanket Implementations Source: https://docs.rs/rust2go/0.4.3/rust2go/enum.ResponseFuture.html Details blanket implementations for ResponseFuture, including Any, Borrow, BorrowMut, From, Into, TryFrom, and TryInto. ```APIDOC ### impl Any for T #### fn type_id(&self) -> TypeId ### impl Borrow for T #### fn borrow(&self) -> &T ### impl BorrowMut for T #### fn borrow_mut(&mut self) -> &mut T ### impl From for T #### fn from(t: T) -> T ### impl Into for T #### fn into(self) -> U ### impl TryFrom for T #### type Error = Infallible #### fn try_from(value: U) -> Result>::Error> ### impl TryInto for T #### type Error = >::Error #### fn try_into(self) -> Result>::Error> ``` -------------------------------- ### Structs Source: https://docs.rs/rust2go/0.4.3/rust2go Documentation for structs provided by the rust2go crate. ```APIDOC ## Structs ### `CopyStruct` *Description: [Description of CopyStruct]* ### `DataView` *Description: [Description of DataView]* ### `ListRef` *Description: [Description of ListRef]* ### `ResponseFutureWithoutReq` *Description: [Description of ResponseFutureWithoutReq]* ### `SlotReader` *Description: [Description of SlotReader]* ### `SlotWriter` *Description: [Description of SlotWriter]* ### `StringRef` *Description: [Description of StringRef]* ### `Writer` *Description: [Description of Writer]* ``` -------------------------------- ### Functions Source: https://docs.rs/rust2go/0.4.3/rust2go Documentation for functions provided by the rust2go crate. ```APIDOC ## Functions ### `new_atomic_slot` *Description: Create a pair of SlotReader and SlotWriter. There’s 2 reasons to use it when async rust to go ffi(Go holds writer and rust holds reader):* *Parameters: [List of parameters for new_atomic_slot]* *Returns: [Description of return value for new_atomic_slot]* ``` -------------------------------- ### Macros in rust2go Source: https://docs.rs/rust2go/0.4.3/rust2go/all.html Lists and describes the available macros in the rust2go library. ```APIDOC ## Macros ### max_mem_type A macro for determining the maximum memory type. ### r2g_include_binding A macro to include bindings for rust2go. ``` -------------------------------- ### Attribute Macros Source: https://docs.rs/rust2go/0.4.3/rust2go Documentation for attribute macros provided by the rust2go crate. ```APIDOC ## Attribute Macros ### `g2r` *Description: [Description of g2r attribute macro]* ### `r2g` *Description: [Description of r2g attribute macro]* ### `r2g_struct_tag` *Description: Mark only* *Parameters: [List of parameters for r2g_struct_tag]* ``` -------------------------------- ### ResponseFuture Methods Source: https://docs.rs/rust2go/0.4.3/rust2go/enum.ResponseFuture.html Provides details on the constructor methods available for the ResponseFuture enum. ```APIDOC ## Implementations ### impl ResponseFuture #### pub fn new(exec: Exec, req: Req, callback: *const ()) -> Self #### pub fn new_without_req( exec: Exec, req: Req, callback: *const (), ) -> ResponseFutureWithoutReq ``` -------------------------------- ### Enums Source: https://docs.rs/rust2go/0.4.3/rust2go Documentation for enums provided by the rust2go crate. ```APIDOC ## Enums ### `MemType` *Description: [Description of MemType enum]* ### `ResponseFuture` *Description: [Description of ResponseFuture enum]* ``` -------------------------------- ### Derive Macros in rust2go Source: https://docs.rs/rust2go/0.4.3/rust2go/all.html Lists and describes the available derive macros in the rust2go library. ```APIDOC ## Derive Macros ### R2G A derive macro for enabling rust2go functionality on structs. ``` -------------------------------- ### Constant DEFAULT_BINDING_FILE Source: https://docs.rs/rust2go/0.4.3/rust2go/constant.DEFAULT_BINDING_FILE.html The default filename for Go bindings generated by rust2go. ```APIDOC ## Constant DEFAULT_BINDING_FILE ### Description Represents the default filename used for Go binding files generated by the rust2go library. This constant is a string literal. ### Value ```rust "_go_bindings.rs" ``` ### Type `&str` ``` -------------------------------- ### Structs in rust2go Source: https://docs.rs/rust2go/0.4.3/rust2go/all.html Lists and describes the available structs in the rust2go library. ```APIDOC ## Structs ### CopyStruct Represents a struct that can be copied. ### DataView Provides a view into data, potentially for read-only access. ### ListRef A reference to a list-like structure. ### ResponseFutureWithoutReq A future that represents a response without an associated request. ### SlotReader An interface for reading from a slot. ### SlotWriter An interface for writing to a slot. ### StringRef A reference to a string. ### Writer An interface for writing data. ``` -------------------------------- ### Functions in rust2go Source: https://docs.rs/rust2go/0.4.3/rust2go/all.html Lists and describes the available functions in the rust2go library. ```APIDOC ## Functions ### new_atomic_slot Creates a new atomic slot. ``` -------------------------------- ### ResponseFuture Implementation Source: https://docs.rs/rust2go/0.4.3/src/rust2go/future.rs.html Implements the `Future` trait for `ResponseFuture`. This allows asynchronous polling and handling of responses from Go FFI calls. It manages the state transitions from initialization to execution and finally to a fused state after the response is ready. Requires `Exec` to be `FnOnce` and `Req` to be `Unpin` and convertible to a reference. ```rust impl Future for ResponseFuture where // Exec: FnOnce(Req, *SlotWriter, Callback) // Note: Req is usually a tuple. Exec: FnOnce(Req::Ref, *const (), *const ()) + Unpin, Req: Unpin + crate::ToRef, { type Output = (Resp, Req); fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let this = self.get_mut(); match this { Self::Executed(reader) => { reader.set_waker(cx.waker()); if let Some((resp, attachment)) = unsafe { reader.read_with_attachment() } { *this = Self::Fused; let (req, _) = attachment.unwrap(); return Poll::Ready((resp, req)); } } Self::Init(..) => { // replace to take ownership let (reader, mut writer) = crate::slot::new_atomic_slot::)>(); let (exec, req, cb) = match std::mem::replace(this, Self::Executed(reader)) { Self::Init(exec, req, cb) => (exec, req, cb), Self::Executed(_) => unsafe { std::hint::unreachable_unchecked() }, Self::Fused => unsafe { std::hint::unreachable_unchecked() }, }; let (buf, req_ref) = req.calc_ref(); writer.attach((req, buf)); writer.set_waker(cx.waker().clone()); // execute the ffi function let w_ptr = writer.into_ptr(); (exec)(req_ref, w_ptr, cb); } Self::Fused => { panic!("Future polled after ready"); } } Poll::Pending } } ``` -------------------------------- ### Attribute Macros in rust2go Source: https://docs.rs/rust2go/0.4.3/rust2go/all.html Lists and describes the available attribute macros in the rust2go library. ```APIDOC ## Attribute Macros ### g2r An attribute macro for Go to Rust conversions. ### r2g An attribute macro for Rust to Go conversions. ### r2g_struct_tag An attribute macro for tagging structs for rust2go. ``` -------------------------------- ### Rust Macro for Including Go Bindings Source: https://docs.rs/rust2go/0.4.3/src/rust2go/lib.rs.html This macro allows including generated Go bindings directly into Rust code. It supports a default binding file name and can be customized with a literal file path. ```rust #[macro_export] macro_rules! r2g_include_binding { () => { include!(concat!(env!("OUT_DIR"), "/_go_bindings.rs")); }; ($file:literal) => { include!(concat!(env!("OUT_DIR"), "/", $file)); }; } ``` -------------------------------- ### Constants in rust2go Source: https://docs.rs/rust2go/0.4.3/rust2go/all.html Lists and describes the available constants in the rust2go library. ```APIDOC ## Constants ### DEFAULT_BINDING_FILE The default file name for bindings. ``` -------------------------------- ### Writer Constructor Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.Writer.html Creates a new Writer instance. The provided pointer must be valid and have sufficient capacity. ```rust pub unsafe fn new(ptr: *mut u8) -> Writer ``` -------------------------------- ### Copy Implementation for DataView Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.DataView.html Indicates that DataView can be copied. ```APIDOC ### impl Copy for DataView ``` -------------------------------- ### Define DEFAULT_BINDING_FILE Constant Source: https://docs.rs/rust2go/0.4.3/rust2go/constant.DEFAULT_BINDING_FILE.html This constant defines the default file name used for Go bindings. It is a string literal representing the file suffix. ```rust pub const DEFAULT_BINDING_FILE: &str = "_go_bindings.rs"; ``` -------------------------------- ### Blanket Implementations Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.DataView.html Details blanket implementations applicable to DataView. ```APIDOC ## Blanket Implementations ### impl Any for T #### fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. ### impl Borrow for T #### fn borrow(&self) -> &T Immutably borrows from an owned value. ### impl BorrowMut for T #### fn borrow_mut(&mut self) -> &mut T Mutably borrows from an owned value. ### impl CloneToUninit for T #### unsafe fn clone_to_uninit(&self, dest: *mut u8) Performs copy-assignment from `self` to `dest`. ### impl From for T #### fn from(t: T) -> T Returns the argument unchanged. ### impl Into for T #### fn into(self) -> U Calls `U::from(self)`. ### impl ToOwned for T #### type Owned = T #### fn to_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. #### fn clone_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. ### impl TryFrom for T #### type Error = Infallible #### fn try_from(value: U) -> Result>::Error> Performs the conversion. ### impl TryInto for T #### type Error = >::Error #### fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### Traits in rust2go Source: https://docs.rs/rust2go/0.4.3/rust2go/all.html Lists and describes the available traits in the rust2go library. ```APIDOC ## Traits ### FromRef A trait for converting from a reference. ### ToRef A trait for converting to a reference. ``` -------------------------------- ### Rust Library Imports and Re-exports Source: https://docs.rs/rust2go/0.4.3/src/rust2go/lib.rs.html This snippet shows the main imports and re-exports for the rust2go library, including data conversion utilities, slot management, and asynchronous response handling. It also re-exports macros for Rust-to-Go and Go-to-Rust conversions. ```rust use std::any::Any; pub use rust2go_convert::{ max_mem_type, CopyStruct, DataView, FromRef, ListRef, MemType, StringRef, ToRef, Writer, }; mod slot; pub use slot::{new_atomic_slot, SlotReader, SlotWriter}; mod future; pub use future::{ResponseFuture, ResponseFutureWithoutReq}; pub use rust2go_macro::{g2r, r2g, r2g_struct_tag, R2G}; pub const DEFAULT_BINDING_FILE: &str = "_go_bindings.rs"; ``` -------------------------------- ### Enums in rust2go Source: https://docs.rs/rust2go/0.4.3/rust2go/all.html Lists and describes the available enums in the rust2go library. ```APIDOC ## Enums ### MemType Represents different memory types or allocation strategies. ### ResponseFuture A future that represents a response, potentially with an associated request. ``` -------------------------------- ### Blanket Implementations Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.StringRef.html Blanket implementations applicable to StringRef. ```APIDOC ## Blanket Implementations ### impl Any for T #### fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. ### impl Borrow for T #### fn borrow(&self) -> &T Immutably borrows from an owned value. ### impl BorrowMut for T #### fn borrow_mut(&mut self) -> &mut T Mutably borrows from an owned value. ### impl CloneToUninit for T #### unsafe fn clone_to_uninit(&self, dest: *mut u8) Performs copy-assignment from `self` to `dest`. ### impl From for T #### fn from(t: T) -> T Returns the argument unchanged. ### impl Into for T #### fn into(self) -> U Calls `U::from(self)`. ### impl ToOwned for T #### type Owned = T #### fn to_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. #### fn clone_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. ### impl TryFrom for T #### type Error = Infallible #### fn try_from(value: U) -> Result>::Error> Performs the conversion. ### impl TryInto for T #### type Error = >::Error #### fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### Implementations of FromRef for Collection Types Source: https://docs.rs/rust2go/0.4.3/rust2go/trait.FromRef.html Shows implementations of the FromRef trait for String, Option, and Vec. ```APIDOC #### impl FromRef for String - **type Ref**: StringRef - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> String` #### impl FromRef for Option - **type Ref**: ListRef - **fn from_ref**: `fn from_ref(ref_: & as FromRef>::Ref) -> Option` #### impl FromRef for Vec - **type Ref**: ListRef - **fn from_ref**: `fn from_ref(ref_: & as FromRef>::Ref) -> Vec` ``` -------------------------------- ### Blanket Implementations for ResponseFutureWithoutReq Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.ResponseFutureWithoutReq.html Details blanket trait implementations available for ResponseFutureWithoutReq, including Any, Borrow, BorrowMut, From, Into, TryFrom, and TryInto. ```APIDOC ## Blanket Implementations ### impl Any for T where T: 'static + ?Sized, #### fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. ### impl Borrow for T where T: ?Sized, #### fn borrow(&self) -> &T Immutably borrows from an owned value. ### impl BorrowMut for T where T: ?Sized, #### fn borrow_mut(&mut self) -> &mut T Mutably borrows from an owned value. ### impl From for T #### fn from(t: T) -> T Returns the argument unchanged. ### impl Into for T where U: From, #### fn into(self) -> U Calls `U::from(self)`. ### impl TryFrom for T where U: Into, #### type Error = Infallible The type returned in the event of a conversion error. #### fn try_from(value: U) -> Result>::Error> Performs the conversion. ### impl TryInto for T where U: TryFrom, #### type Error = >::Error The type returned in the event of a conversion error. #### fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### Send and Sync Trait Implementations Source: https://docs.rs/rust2go/0.4.3/rust2go/enum.ResponseFuture.html Information on the Send and Sync trait implementations for ResponseFuture, indicating thread-safety. ```APIDOC ### impl Send for ResponseFuture ### impl Sync for ResponseFuture ``` -------------------------------- ### TryInto Implementation Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.SlotWriter.html Implements `TryInto` for attempting conversions. The `try_into` method performs the conversion and returns a `Result`. The associated `Error` type is derived from the `TryFrom` implementation. ```rust type Error = >::Error ``` ```rust fn try_into(self) -> Result>::Error> ``` -------------------------------- ### Auto Trait Implementations Source: https://docs.rs/rust2go/0.4.3/rust2go/enum.ResponseFuture.html Lists the auto trait implementations for ResponseFuture, such as Freeze, RefUnwindSafe, Unpin, and UnwindSafe. ```APIDOC ### impl Freeze for ResponseFuture ### impl RefUnwindSafe for ResponseFuture ### impl Unpin for ResponseFuture ### impl UnwindSafe for ResponseFuture ``` -------------------------------- ### ResponseFuture Constructors and Enum Definition Source: https://docs.rs/rust2go/0.4.3/src/rust2go/future.rs.html Defines the `ResponseFuture` enum with variants for initialization, execution, and a fused state. Includes constructors `new` and `new_without_req` for creating `ResponseFuture` and `ResponseFutureWithoutReq` instances respectively. The `Init` variant holds the executor, request, and callback pointer. ```rust impl ResponseFuture { pub fn new(exec: Exec, req: Req, callback: *const ()) -> Self { Self::Init(exec, req, callback) } pub fn new_without_req( exec: Exec, req: Req, callback: *const (), ) -> ResponseFutureWithoutReq { ResponseFutureWithoutReq(Self::Init(exec, req, callback)) } } pub enum ResponseFuture { // go ffi function, request, callback function ptr Init(Exec, Req, *const ()), // slot Executed(SlotReader)>), Fused, } ``` -------------------------------- ### Clone Implementation for DataView Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.DataView.html Provides methods for creating duplicates of DataView instances. ```APIDOC ## Trait Implementations ### impl Clone for DataView #### fn clone(&self) -> DataView Returns a duplicate of the value. ### impl Clone for DataView #### fn clone_from(&mut self, source: &Self) Performs copy-assignment from `source`. ``` -------------------------------- ### Implementations of FromRef for Primitive Types Source: https://docs.rs/rust2go/0.4.3/rust2go/trait.FromRef.html Shows implementations of the FromRef trait for various primitive data types. ```APIDOC ### Implementations on Foreign Types #### impl FromRef for bool - **type Ref**: bool - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> bool` #### impl FromRef for char - **type Ref**: char - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> char` #### impl FromRef for f32 - **type Ref**: f32 - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> f32` #### impl FromRef for f64 - **type Ref**: f64 - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> f64` #### impl FromRef for i8 - **type Ref**: i8 - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> i8` #### impl FromRef for i16 - **type Ref**: i16 - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> i16` #### impl FromRef for i32 - **type Ref**: i32 - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> i32` #### impl FromRef for i64 - **type Ref**: i64 - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> i64` #### impl FromRef for isize - **type Ref**: isize - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> isize` #### impl FromRef for u8 - **type Ref**: u8 - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> u8` #### impl FromRef for u16 - **type Ref**: u16 - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> u16` #### impl FromRef for u32 - **type Ref**: u32 - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> u32` #### impl FromRef for u64 - **type Ref**: u64 - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> u64` #### impl FromRef for usize - **type Ref**: usize - **fn from_ref**: `fn from_ref(ref_: &::Ref) -> usize` ``` -------------------------------- ### impl Any for T Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.CopyStruct.html Implementation of the `Any` trait for any type `T` that is `'static` and `?Sized`. ```APIDOC ## impl Any for T where T: 'static + ?Sized ### `fn type_id(&self) -> TypeId` Gets the `TypeId` of `self`. ``` -------------------------------- ### TRef for Tuples (15 elements) Source: https://docs.rs/rust2go/0.4.3/rust2go/trait.ToRef.html Implementation of ToRef for tuples containing up to 15 elements, where each element must also implement ToRef. ```APIDOC ## impl ToRef for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) where T1: ToRef, T2: ToRef, T3: ToRef, T4: ToRef, T5: ToRef, T6: ToRef, T7: ToRef, T8: ToRef, T9: ToRef, T10: ToRef, T11: ToRef, T12: ToRef, T13: ToRef, T14: ToRef, T15: ToRef, ### Constants - **MEM_TYPE**: MemType ### Types - **Ref**: (::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref) ### Methods - **to_size**: fn to_size(&self, acc: &mut usize) - **to_ref**: fn to_ref( &self, buffer: &mut Writer, ) -> <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) as ToRef>::Ref ``` -------------------------------- ### ResponseFutureWithoutReq Source: https://docs.rs/rust2go/0.4.3/src/rust2go/future.rs.html A wrapper around `ResponseFuture` that simplifies the output type to only the response, discarding the original request. ```APIDOC ## ResponseFutureWithoutReq ### Description A struct that wraps `ResponseFuture` to provide a simplified `Future` output, yielding only the `Resp` type. ### Future Implementation ```rust impl Future for ResponseFutureWithoutReq where ResponseFuture: Future, { type Output = Resp; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { // Polls the inner ResponseFuture and maps the output to just the response. unsafe { Pin::new_unchecked(&mut self.get_unchecked_mut().0) } .poll(cx) .map(|r| r.0) } } ``` ``` -------------------------------- ### SlotReader Blanket Implementations Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.SlotReader.html Showcases blanket implementations for common traits on SlotReader. ```APIDOC ## Blanket Implementations ### impl Any for T where T: 'static + ?Sized, #### fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. Read more ### impl Borrow for T where T: ?Sized, #### fn borrow(&self) -> &T Immutably borrows from an owned value. Read more ### impl BorrowMut for T where T: ?Sized, #### fn borrow_mut(&mut self) -> &mut T Mutably borrows from an owned value. Read more ### impl From for T #### fn from(t: T) -> T Returns the argument unchanged. ### impl Into for T where U: From, #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `From for U` chooses to do. ### impl TryFrom for T where U: Into, #### type Error = Infallible The type returned in the event of a conversion error. #### fn try_from(value: U) -> Result>::Error> Performs the conversion. ### impl TryInto for T where U: TryFrom, #### type Error = >::Error The type returned in the event of a conversion error. #### fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### ListRef Struct Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.ListRef.html Documentation for the ListRef struct, including its definition and available trait implementations. ```APIDOC ## Struct ListRef ### Summary ```rust pub struct ListRef(/* private fields */); ``` ## Trait Implementations ### impl Clone for ListRef #### fn clone(&self) -> ListRef Returns a duplicate of the value. #### fn clone_from(&mut self, source: &Self) Performs copy-assignment from `source`. ### impl Debug for ListRef #### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> Formats the value using the given formatter. ### impl Copy for ListRef ## Auto Trait Implementations ### impl Freeze for ListRef ### impl RefUnwindSafe for ListRef ### impl !Send for ListRef ### impl !Sync for ListRef ### impl Unpin for ListRef ### impl UnwindSafe for ListRef ## Blanket Implementations ### impl Any for T #### fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. ### impl Borrow for T #### fn borrow(&self) -> &T Immutably borrows from an owned value. ### impl BorrowMut for T #### fn borrow_mut(&mut self) -> &mut T Mutably borrows from an owned value. ### impl CloneToUninit for T #### unsafe fn clone_to_uninit(&self, dest: *mut u8) Performs copy-assignment from `self` to `dest`. ### impl From for T #### fn from(t: T) -> T Returns the argument unchanged. ### impl Into for T #### fn into(self) -> U Calls `U::from(self)`. ### impl ToOwned for T #### type Owned = T The resulting type after obtaining ownership. #### fn to_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. #### fn clone_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. ### impl TryFrom for T #### type Error = Infallible The type returned in the event of a conversion error. #### fn try_from(value: U) -> Result>::Error> Performs the conversion. ### impl TryInto for T #### type Error = >::Error The type returned in the event of a conversion error. #### fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### TRef for Tuples (13 elements) Source: https://docs.rs/rust2go/0.4.3/rust2go/trait.ToRef.html Implementation of ToRef for tuples containing up to 13 elements, where each element must also implement ToRef. ```APIDOC ## impl ToRef for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) where T1: ToRef, T2: ToRef, T3: ToRef, T4: ToRef, T5: ToRef, T6: ToRef, T7: ToRef, T8: ToRef, T9: ToRef, T10: ToRef, T11: ToRef, T12: ToRef, T13: ToRef, ### Constants - **MEM_TYPE**: MemType ### Types - **Ref**: (::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref) ### Methods - **to_size**: fn to_size(&self, acc: &mut usize) - **to_ref**: fn to_ref( &self, buffer: &mut Writer, ) -> <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) as ToRef>::Ref ``` -------------------------------- ### r2g_include_binding Macro Source: https://docs.rs/rust2go/0.4.3/rust2go/macro.r2g_include_binding.html The r2g_include_binding macro is used to include bindings within the rust2go framework. It supports an optional file literal argument. ```APIDOC ## Macro: r2g_include_binding ### Description A macro used to include bindings in a rust2go project. It can be invoked without arguments or with a specific file path. ### Syntax - `r2g_include_binding!()` - `r2g_include_binding!($file:literal)` ### Parameters - **$file** (literal) - Optional - The path to the binding file to be included. ``` -------------------------------- ### Trait Implementations for StringRef Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.StringRef.html Documentation for the traits implemented by the StringRef struct. ```APIDOC ## Trait Implementations ### impl Clone for StringRef #### fn clone(&self) -> StringRef Returns a duplicate of the value. #### fn clone_from(&mut self, source: &Self) Performs copy-assignment from `source`. ### impl Debug for StringRef #### fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> Formats the value using the given formatter. ### impl Copy for StringRef ``` -------------------------------- ### FromRef Implementation for i64 Source: https://docs.rs/rust2go/0.4.3/rust2go/trait.FromRef.html Implements the FromRef trait for the i64 type. The reference type is i64. ```rust impl FromRef for i64 { type Ref = i64; fn from_ref(ref_: &::Ref) -> i64 } ``` -------------------------------- ### ResponseFuture::new Function Source: https://docs.rs/rust2go/0.4.3/rust2go/enum.ResponseFuture.html Constructor for ResponseFuture. Initializes the future with an executor, a request, and a callback pointer. Requires the Exec type to be `FnOnce` and `Unpin`, and Req to be `Unpin` and `ToSend`. ```rust pub fn new(exec: Exec, req: Req, callback: *const ()) -> Self ``` -------------------------------- ### unsafe fn new Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.Writer.html Creates a new instance of the Writer struct from a raw pointer. ```APIDOC ## unsafe fn new ### Description Creates a new Writer instance. This operation is unsafe as it requires a valid pointer with sufficient capacity. ### Parameters #### Path Parameters - **ptr** (*mut u8) - Required - A raw pointer to a memory buffer. ### Safety The pointer must be valid, and it must have enough capacity to support the operations performed by the Writer. ``` -------------------------------- ### SlotWriter Blanket Implementations Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.SlotWriter.html Information on blanket implementations for SlotWriter. ```APIDOC ## Blanket Implementations for SlotWriter ### `Any` Trait - **Description**: Provides runtime type information. - **Method**: `fn type_id(&self) -> TypeId` ### `Borrow` Trait - **Description**: Immutably borrows from an owned value. - **Method**: `fn borrow(&self) -> &T` ### `BorrowMut` Trait - **Description**: Mutably borrows from an owned value. - **Method**: `fn borrow_mut(&mut self) -> &mut T` ### `From` Trait - **Description**: Creates an instance from another type. - **Method**: `fn from(t: T) -> T` ### `Into` Trait - **Description**: Converts into another type. - **Method**: `fn into(self) -> U` ### `TryFrom` Trait - **Description**: Performs a fallible conversion from another type. - **Type Alias**: `Error = Infallible` - **Method**: `fn try_from(value: U) -> Result>::Error>` ### `TryInto` Trait - **Description**: Performs a fallible conversion into another type. - **Type Alias**: `Error = >::Error` - **Method**: `fn try_into(self) -> Result>::Error>` ``` -------------------------------- ### Auto Trait Implementations for ResponseFutureWithoutReq Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.ResponseFutureWithoutReq.html Lists the automatic trait implementations for ResponseFutureWithoutReq, such as Send, Sync, Unpin, Freeze, and RefUnwindSafe. ```APIDOC ## Auto Trait Implementations ### impl Freeze for ResponseFutureWithoutReq where Exec: Freeze, Req: Freeze, ### impl RefUnwindSafe for ResponseFutureWithoutReq where Exec: RefUnwindSafe, Req: RefUnwindSafe, Resp: RefUnwindSafe, ### impl Send for ResponseFutureWithoutReq where Req: Send, Resp: Send, ### impl Sync for ResponseFutureWithoutReq where Req: Sync, Resp: Sync, ### impl Unpin for ResponseFutureWithoutReq where Exec: Unpin, Req: Unpin, ### impl UnwindSafe for ResponseFutureWithoutReq where Exec: UnwindSafe, Req: UnwindSafe + RefUnwindSafe, Resp: RefUnwindSafe, ``` -------------------------------- ### TRef for Tuples (16 elements) Source: https://docs.rs/rust2go/0.4.3/rust2go/trait.ToRef.html Implementation of ToRef for tuples containing up to 16 elements, where each element must also implement ToRef. ```APIDOC ## impl ToRef for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) where T1: ToRef, T2: ToRef, T3: ToRef, T4: ToRef, T5: ToRef, T6: ToRef, T7: ToRef, T8: ToRef, T9: ToRef, T10: ToRef, T11: ToRef, T12: ToRef, T13: ToRef, T14: ToRef, T15: ToRef, T16: ToRef, ### Constants - **MEM_TYPE**: MemType ### Types - **Ref**: (::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref) ### Methods - **to_size**: fn to_size(&self, acc: &mut usize) - **to_ref**: fn to_ref( &self, buffer: &mut Writer, ) -> <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) as ToRef>::Ref ``` -------------------------------- ### ResponseFuture::new_without_req Function Source: https://docs.rs/rust2go/0.4.3/rust2go/enum.ResponseFuture.html Constructor for ResponseFuture that does not require a request object. Initializes the future with an executor and a callback pointer. Returns a ResponseFutureWithoutReq. ```rust pub fn new_without_req( exec: Exec, req: Req, callback: *const (), ) -> ResponseFutureWithoutReq ``` -------------------------------- ### Struct ResponseFutureWithoutReq Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.ResponseFutureWithoutReq.html Details of the ResponseFutureWithoutReq struct, including its definition and tuple fields. ```APIDOC ## Struct ResponseFutureWithoutReq ### Summary ```rust pub struct ResponseFutureWithoutReq(pub ResponseFuture); ``` ## Tuple Fields * `0: ResponseFuture` ``` -------------------------------- ### TRef for Tuples (12 elements) Source: https://docs.rs/rust2go/0.4.3/rust2go/trait.ToRef.html Implementation of ToRef for tuples containing up to 12 elements, where each element must also implement ToRef. ```APIDOC ## impl ToRef for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) where T1: ToRef, T2: ToRef, T3: ToRef, T4: ToRef, T5: ToRef, T6: ToRef, T7: ToRef, T8: ToRef, T9: ToRef, T10: ToRef, T11: ToRef, T12: ToRef, ### Constants - **MEM_TYPE**: MemType ### Types - **Ref**: (::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref) ### Methods - **to_size**: fn to_size(&self, acc: &mut usize) - **to_ref**: fn to_ref( &self, buffer: &mut Writer, ) -> <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) as ToRef>::Ref ``` -------------------------------- ### FromRef Implementation for f64 Source: https://docs.rs/rust2go/0.4.3/rust2go/trait.FromRef.html Implements the FromRef trait for the f64 type. The reference type is f64. ```rust impl FromRef for f64 { type Ref = f64; fn from_ref(ref_: &::Ref) -> f64 } ``` -------------------------------- ### r2g Attribute Macro Source: https://docs.rs/rust2go/0.4.3/rust2go/attr.r2g.html The r2g attribute macro is the primary entry point for the rust2go crate functionality. ```APIDOC ## Attribute Macro r2g ### Description The `r2g` attribute macro is used to annotate items for processing by the rust2go crate. ### Usage ```rust #[r2g] ``` ``` -------------------------------- ### TRef for Tuples (14 elements) Source: https://docs.rs/rust2go/0.4.3/rust2go/trait.ToRef.html Implementation of ToRef for tuples containing up to 14 elements, where each element must also implement ToRef. ```APIDOC ## impl ToRef for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) where T1: ToRef, T2: ToRef, T3: ToRef, T4: ToRef, T5: ToRef, T6: ToRef, T7: ToRef, T8: ToRef, T9: ToRef, T10: ToRef, T11: ToRef, T12: ToRef, T13: ToRef, T14: ToRef, ### Constants - **MEM_TYPE**: MemType ### Types - **Ref**: (::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref, ::Ref) ### Methods - **to_size**: fn to_size(&self, acc: &mut usize) - **to_ref**: fn to_ref( &self, buffer: &mut Writer, ) -> <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) as ToRef>::Ref ``` -------------------------------- ### Conversion Traits (From, Into, TryFrom, TryInto) Source: https://docs.rs/rust2go/0.4.3/rust2go/struct.CopyStruct.html Traits for performing type conversions between different types. ```APIDOC ## From ### Description Returns the argument unchanged. ### Method fn from(t: T) -> T ## Into ### Description Calls U::from(self) to perform conversion. ### Method fn into(self) -> U ## TryFrom ### Description Performs a fallible conversion. ### Method fn try_from(value: U) -> Result>::Error> ## TryInto ### Description Performs a fallible conversion into another type. ### Method fn try_into(self) -> Result>::Error> ```