This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl Serialize for PlatformNotification { | |
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> | |
where S: Serializer | |
{ | |
use self::PlatformNotification::*; | |
match self { | |
&Apn(ref apn, _) => apn.serialize(serializer), | |
&Gcm(ref gcm, _) => gcm.serialize(serializer), | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)] | |
#[serde(untagged)] | |
pub enum PlatformNotification { | |
Apn( | |
ApnNotification, | |
#[serde(skip)] | |
Url), | |
Gcm( | |
GcmNotification, | |
#[serde(skip)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustup_date() { | |
if [ -z "$1" ]; then | |
echo "usage: rustup_date 'YYYY-MM-DD'" | |
else | |
rustup override set nightly-${1} | |
rustup default nightly-${1} | |
rustup component add rls-preview --toolchain nightly-${1} | |
rustup component add rust-analysis --toolchain nightly-${1} | |
rustup component add rust-src --toolchain nightly-${1} | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl<K,T> Set<K,T> | |
where K : Serialize + DeserializeOwned + Ord + Clone, | |
T : Serialize + DeserializeOwned + Ord + Clone, | |
{ | |
pub fn new(db: Arc<DB>, cf: ColumnFamily) -> Set<K,T> { | |
Set { db, cf, p1: PhantomData, p2: PhantomData } | |
} | |
pub fn create<I>(&self, key: &K, values: I, ttl: Option<i64>) -> Result<(), Error> | |
where for<'a> &'a I: IntoIterator<Item=&'a T> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl<K,U,V> Map<K,U,V> | |
where K: Serialize + DeserializeOwned + Ord + Clone, | |
U: Serialize + DeserializeOwned + Ord + Clone, | |
V: Serialize + DeserializeOwned + Clone, | |
{ | |
pub fn new(db: Arc<DB>, cf: ColumnFamily) -> Map<K,U,V> { | |
Map { db, cf, p1: PhantomData, p2: PhantomData, p3: PhantomData } | |
} | |
pub fn create<'a, I>(&self, key: &K, values: I, ttl: Option<i64>) -> Result<(), Error> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn create<'a, I>(&self, key: &K, values: I, ttl: Option<i64>) -> Result<(), Error> | |
where I: Iterator<Item=&'a T> | |
{ | |
let kbuf = serialize(&key, Infinite)?; | |
let mut vbuf : Vec<u8> = Vec::with_capacity(32); | |
set_ttl(&mut vbuf, ttl)?; | |
{ | |
let val : VecDeque<&T> = values.collect(); | |
serialize_into(&mut vbuf, &val, Infinite).map_err(Error::from)?; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn get<'de, V>(&self, key: &[u8]) -> Result<Option<V>, Error> | |
where | |
V: Deserialize<'de>, | |
{ | |
let res = self.db.get_cf(self.cf, key)?; | |
if let Some(inbuf) = res { | |
let v: V = deserialize(&inbuf[HDR_LEN..]).map_err(Error::from)?; | |
Ok(Some(v)) | |
} else { | |
Ok(None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thread '<unnamed>' panicked at 'could not run cargo: CargoError(Msg("failed to run `rustc` to learn about target-specific information"), State { next_error: Some(CargoError(ProcessErrorKind(ProcessError { desc: "process didn\'t exit successfully: `rustc - --crate-name ___ --print=file-names --error-format=json -Zcontinue-parse-after-error -Zsave-analysis -Zunstable-options --target x86_64-unknown-linux-gnu --crate-type bin --crate-type rlib` (exit code: 101)\n--- stderr\nerror: the option `Z` is only accepted on the nightly compiler\n\n", exit: Some(ExitStatus(ExitStatus(25856))), output: Some(Output { status: ExitStatus(ExitStatus(25856)), stdout: "", stderr: "error: the option `Z` is only accepted on the nightly compiler\n\n" }) }), State { next_error: None, backtrace: None })), backtrace: None })', /checkout/src/libcore/result.rs:906:4 | |
note: Run with `RUST_BACKTRACE=1` for a backtrace. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error[E0308]: mismatched types | |
--> /home/rick/.cargo/registry/src/github.com-1ecc6299db9ec823/config-0.7.0/src/path/parser.rs:68:32 | |
| | |
68 | return result.to_result(); | |
| ^^^^^^^^^^^^^^^^^^ expected enum `nom::ErrorKind`, found enum `nom::Err` | |
| | |
= note: expected type `std::result::Result<_, nom::ErrorKind>` | |
found type `std::result::Result<_, nom::Err<&[u8]>>` | |
error[E0308]: match arms have incompatible types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Rick Richardson <[email protected]> | |
# License Apache2 or MIT | |
# * What this does * | |
# | |
# This script will install RLS and the Vim Language Server Plugin found here : | |
# https://github.com/prabirshrestha/vim-lsp | |
# * Credit * |