зеркало из https://github.com/mozilla/uniffi-rs.git
uniffi::use_remote_type uses 'crate::name' form to specify types. (#2325)
This commit is contained in:
Родитель
e0fd13ffbf
Коммит
aa200a689a
|
@ -92,7 +92,7 @@ Types that are remote and external require a `use_remote_type!` macro call.
|
|||
If `crate_a` defines [IpAddr](https://doc.rust-lang.org/std/net/enum.IpAddr.html) as a remote type, then `crate_b` can use that type with the following Rust code:
|
||||
|
||||
```rust
|
||||
uniffi::use_remote_type!(crate_a, IpAddr);
|
||||
uniffi::use_remote_type!(crate_a::IpAddr);
|
||||
```
|
||||
|
||||
## UDL
|
||||
|
|
|
@ -12,7 +12,7 @@ use uniffi_sublib::SubLibType;
|
|||
use url::Url;
|
||||
|
||||
// Remote types require a macro call in the Rust source
|
||||
uniffi::use_remote_type!(custom_types, Url);
|
||||
uniffi::use_remote_type!(custom_types::Url);
|
||||
|
||||
pub struct CombinedType {
|
||||
pub uoe: UniffiOneEnum,
|
||||
|
|
|
@ -6,7 +6,7 @@ use uniffi_one::{
|
|||
};
|
||||
use url::Url;
|
||||
|
||||
uniffi::use_remote_type!(custom_types, Url);
|
||||
uniffi::use_remote_type!(custom_types::Url);
|
||||
|
||||
#[derive(uniffi::Record)]
|
||||
pub struct CombinedType {
|
||||
|
|
|
@ -11,7 +11,7 @@ use syn::{
|
|||
|
||||
pub struct RemoteTypeArgs {
|
||||
pub implementing_crate: Ident,
|
||||
pub sep: Token![,],
|
||||
pub sep: Token![::],
|
||||
pub ty: Type,
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче