Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift Demo not compiled #567

Open
videni opened this issue Mar 2, 2025 · 2 comments · May be fixed by #568
Open

Swift Demo not compiled #567

videni opened this issue Mar 2, 2025 · 2 comments · May be fixed by #568

Comments

@videni
Copy link

videni commented Mar 2, 2025

Hi, how do you guys fix this the error please? I am using the latest code from the master.

apps/swift/octobase-demo/octobase_demoApp.swift#L26C1-L27C1

class JwstWorkspace: ObservableObject {
    var workspace: Workspace
    
    init (workspace: String) {
      // Not compiled ,  even changing it to Workspace(ptr: workspace.intoRustString())
        self.workspace = Workspace(workspace)
    }
}

Error

OctoBase/apps/swift/octobase-demo/octobase_demoApp.swift:26:36 Cannot convert value of type 'String' to expected argument type 'UnsafeMutableRawPointer'
@affine-bot
Copy link

Hello! Thank you for filing an issue.
If this is a bug report, please include relevant logs to help us debug the problem.

@videni
Copy link
Author

videni commented Mar 2, 2025

Must add following to Workspace ffi.

   extern "Rust" {
        type Workspace;

        #[swift_bridge(init)]
        fn new(id: String) -> Workspace;
}

@videni videni closed this as completed Mar 2, 2025
@videni videni reopened this Mar 2, 2025
@videni videni linked a pull request Mar 2, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants