SDK Setup Guides
Rust
Setting Up
this quickstart provides step by step instructions on installing and setting up the ditto sdk in your rust project to integrate ditto with your app create a new project and add the ditto sdk as a project dependency (creating project and installing ditto sdk) set up the directory and file structure for your project (setting up project layout) configure your project for cross compilation (configuring for cross compilation) creating project and installing ditto sdk create a new rust project that uses the ditto sdk create your new rust project by running cargo init bin from the cargo toml file in your project directory, add the ditto sdk as a project dependency cargo \[dependencies dittolive ditto] version = "4 3 0" setting up project layout the rust programming language does not enforce that you use a specific file structure on your app’s end user device’s filesystem; you can organize your project layout however you prefer; however, ditto recommends that you organize and structure your project layout as follows approot/ \| app executable \| libdittoffi dll \| ditto data/ app entry point approot/appexecutable the approot/appexecutable path is the entry point of your app that contains your app’s main executable file structure everything else in your filesystem relative to the approot/appexecutable path by default, the binary component of ditto ( libdittoffi dll ) is statically linked into your app’s main executable file for more information, see dynamic link library libdittooffi dll, as follows dynamic link library approot/libdittooffi dll the approot/libdittoffi dll path contains the binary component of ditto ditto’s binary component is a pre compiled shared library file, also known as the dynamic link library (dll) this libdittoffi dll file contains the actual code implementations that enable ditto platform capabilities, such as data sync if you want to use ditto’s dynamic link library, configure your app’s linker to search for the libdittoffi dll file in this path at build for example, if configuring the linker to reference the @executable path , configure your app’s linker as @executable path/ /libdittoffi dylib when distributing your app to end users, if you are using the ditto sdk’s shared library version, you must include the build output directory’s shared library file in your distributed app configuring for cross compilation with rust’s native support for cross compilation, you can deploy your code on a wide range of environments and platforms for instance, using the same rust code, you can cross compile to create native code that runs on ios and android platforms for mobile apps; webassembly (wasm), rust in the browser deployment; as well as linux and macos for desktop and server apps