Here is the link to the rustup website
Here are the docs for rustup
curl https://sh.rustup.rs -sSf | sh
(This is now the official rust version manager!)
localStorage.setItem('wow', "hello") | |
localStorage.getItem('wow') | |
console.log('ok') | |
alert('WOW') |
Here is the link to the rustup website
Here are the docs for rustup
curl https://sh.rustup.rs -sSf | sh
(This is now the official rust version manager!)lspi.createRecord("testOne") | |
// Now that you have created a record try grabbing it | |
lspi.getRecord("testOne") | |
// This returns an empty object. Now we add a real object | |
lspi.updateRecord("testOne", {test: "Basic data for the 'testOne' record"}) |
extern crate rustc_serialize; | |
extern crate stringer; | |
use rustc_serialize::json::{self}; | |
use std::collections::HashMap; | |
use std::ffi::CString; | |
use std::os::raw::c_char; | |
use stringer::*; | |
#[no_mangle] |
class RustPoro | |
extend FFI::Library | |
@ffi_lib_path = BinaryPath.new.rust_binary | |
ffi_lib @ffi_lib_path | |
attach_function :read_json, [:string], :string | |
end |
extern crate rustc_serialize; | |
use rustc_serialize::json::{self}; | |
use std::collections::HashMap; | |
use std::ffi::CStr; | |
use std::ffi::CString; | |
use std::os::raw::c_char; | |
#[no_mangle] | |
pub extern fn read_json(ro: *const c_char) -> *const c_char { |
#[no_mangle] | |
pub extern fn read_json(ro: *const c_char) -> *const c_char { | |
let roo = make_string(ro); | |
let json_for_rust: HashMap<String, i32> = json::decode(&roo).unwrap(); | |
let encoded = json::encode(&json_for_rust).unwrap(); | |
let concated_string = CString::new(encoded).unwrap(); | |
concated_string.into_raw() | |
} | |
fn make_string(s1: *const c_char) -> String { |
RUST_BACKTRACE=1 cargo build | |
Compiling rust v0.1.0 (file:///Users/RJPB2/Documents/rustedrails/bin/embedded/rust) | |
error: linking with `cc` failed: exit code: 1 | |
note: "cc" "-m64" "-L" "/Users/RJPB2/.multirust/toolchains/nightly/lib/rustlib/x86_64-apple-darwin/lib" "/Users/RJPB2/Documents/rustedrails/bin/embedded/rust/target/debug/nth_prime.0.o" "-o" "/Users/RJPB2/Documents/rustedrails/bin/embedded/rust/target/debug/libnth_prime.dylib" "/Users/RJPB2/Documents/rustedrails/bin/embedded/rust/target/debug/nth_prime.metadata.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/RJPB2/Documents/rustedrails/bin/embedded/rust/target/debug" "-L" "/Users/RJPB2/Documents/rustedrails/bin/embedded/rust/target/debug/deps" "-L" "/Users/RJPB2/.rbenv/versions/2.3.0/lib" "-L" "/Users/RJPB2/.multirust/toolchains/nightly/lib/rustlib/x86_64-apple-darwin/lib" "-Wl,-force_load,/var/folders/db/31c017ks01x4sgzbfzzrvl780000gn/T/rustc.8QXOubNLwv5f/libruru-90b63cc301e85c86.rlib" "-Wl,-force_load,/var/folders/db/31c017ks01x4sgzbfzzrvl780000 |