pub struct GoMapper;Expand description
TypeMapper for Go bindings.
Maps Rust types to idiomatic Go types:
- Integers use Go’s explicit-width types (uint8, int32, etc.)
- usize/isize map to uint/int (platform-native width)
Optional<T>becomes*T(nullable pointer)Vec<T>becomes[]TMap<K,V>becomesmap[K]V- JSON becomes json.RawMessage
- Unit becomes “” (void in Go — no type in return position)
- Duration becomes uint64 (milliseconds)
Trait Implementations§
Source§impl TypeMapper for GoMapper
impl TypeMapper for GoMapper
Source§fn primitive(&self, prim: &PrimitiveType) -> Cow<'static, str>
fn primitive(&self, prim: &PrimitiveType) -> Cow<'static, str>
Map a primitive type. Default: Rust type names.
Source§fn error_wrapper(&self) -> &str
fn error_wrapper(&self) -> &str
The error wrapper type for this language. e.g. “PyResult”, “napi::Result”, “PhpResult”
Auto Trait Implementations§
impl Freeze for GoMapper
impl RefUnwindSafe for GoMapper
impl Send for GoMapper
impl Sync for GoMapper
impl Unpin for GoMapper
impl UnsafeUnpin for GoMapper
impl UnwindSafe for GoMapper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more