NordSecurity / uniffi-bindgen-cs

C# bindings generator for uniffi-rs
https://github.com/NordSecurity/uniffi-bindgen-cs
Mozilla Public License 2.0
112 stars 21 forks source link

Name collisions with supporting types #39

Open arg0d opened 1 year ago

arg0d commented 1 year ago

There are a bunch of supporting/internal types that can cause name collisions with consumer's namespace. These aren't very generic and not used very often unlike some other types, i.e. File, Stream, etc.., but thinking long term this could for sure create problems for someone. I wonder maybe its possible to neatly wrap all these supporting types into their own namespace.

AllocationException
BigEndianStream
CallStatusErrorHandler
ConcurrentHandleMap
FfiConverter*
FFIObject
FFIObjectUtil
FFISafeHandle
ForeignBytes
ForeignCallback
InternalException
InvalidEnumException
NullCallStatusErrorHandler
PanicException
RustBuffer
RustCallStatus
StreamUnderflowException
UndeclaredErrorException
UniffiException
meenzen commented 11 months ago

In C# 11 it is possible to scope types to a specific file: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/file