std::path::Path size problem #2357
-
Quite new to this package but it looks really promising. Good job. Currently I am trying to manually export third party crate with One of the arguments are of type Just if I try to mirror pub use std::path::Path;
#[frb(mirror(Path))]
pub struct _Path {
inner: std::ffi::OsStr,
}
#[frb(external)]
impl Path {
pub fn new(inner: String) -> Self {}
} I get the following compilation error: error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> src/frb_generated.rs:313:5
|
313 | flutter_rust_bridge::for_generated::RustAutoOpaqueInner<Path>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `std::path::Path`, the trait `Sized` is not implemented for `[u8]`, which is required by `std::path::Path: Sized`
note: required because it appears within the type `std::path::Path`
--> /home/jonb/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/path.rs:2004:12
|
2004 | pub struct Path {
| ^^^^
note: required by an implicit `Sized` bound in `RustAutoOpaqueInner`
--> /home/jonb/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge-2.5.0/src/rust_auto_opaque/inner.rs:6:32
|
6 | pub struct RustAutoOpaqueInner<T> {
| ^ required by the implicit `Sized` requirement on this type parameter in `RustAutoOpaqueInner` Is there some way around this? |
Beta Was this translation helpful? Give feedback.
Answered by
fzyzcjy
Oct 21, 2024
Replies: 1 comment
-
Thank you!
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jbbjarnason
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!
&Path
is like&str
(roughly speaking, "borrowed"). Thus one way is to havePathBuf
(which is like String - owned). Another way is to convert everything from/toString
.