Hello,
with 0.11.0, this code was ok
pub struct Cursor'a, 'b {
pStmt : 'b Statement'a,
error : bool
}
now, with the nighly, i receive a
sql\connection.rs:50:1: 53:2 error: in type `'b
sql::connection::Statement'a`, reference has a longer lifetime than the
data it references
i have started a small personal project, with for the moment, an only (but
working) SQLite suport, you can find it here
mainpage : http://chris-pe.github.io/Rustic/
github : https://github.com/chris-pe/Rustic
documentation : http://www.rust-ci.org/chris-pe/Rustic/doc/rustic/
An example of how to
on
it .
* Laxmi Narayan Patel*
* MCA NIT Durgapur ( Final year)*
* Mob:-8345847473*
On Mon, Jun 9, 2014 at 2:27 PM, Christophe Pedretti
christophe.pedre...@gmail.com wrote:
i have started a small personal project, with for the moment
Great Thanks to all,
now i have a more precise idea.
So, to summarize
if the function takes a vector as argument, transforms it, and return it,
with no need for the caller to use the argument
fn my_func(src: Vecu8) - Vecu8
if the functons takes a vector argument and use it just for a temporary
Hello all,
I've read this :
http://words.steveklabnik.com/pointers-in-rust-a-guide
I am coming from Java where everything is passed and returned by
reference (except for primitive data types), no choice.
I know that with C, you have to use pointers to avoid passing and
returning by value.
When
Hi all,
suppose i want to replace the i th character c (this character is ascii, so
represented by exactly one byte) in a String named buf with character 'a'
i can do this
buf =
buf.as_slice().slice_to(i).to_string().append(a).append(buf.as_slice().slice_from(i+1))
if c is any UTF8 character, i
and using mut_iter() instead of iter() is not enough ?
2014-06-01 22:03 GMT+02:00 Cameron Zwarich zwar...@mozilla.com:
The simplest thing to do is probably to build an intermediate vector of
vertices to insert and then push them all after you are done iterating over
the edges.
Cameron
using a new lifetime.
pub fn execute_query'b('b mut self) - ResultSelf'b;
-Kevin
On May 30, 2014, at 1:54 AM, Christophe Pedretti
christophe.pedre...@gmail.com wrote:
Hi All,
sorry for my late replay, i am UTC+2
Won't wrapping the first `for` loop into curly braces help
Hi all,
i have updated my rust compiler, i have several compilations errors on my
project
1. StrBuf does not exist any more, no problem, i now use String
2. ~ is obsolete, no problem, i use box
3. The last isssue is failed to find an implementation of trait
core::cmp::TotalEq for
{
self.props.contains_key(key)
}
}
2014-05-31 22:21 GMT+04:00 Christophe Pedretti
christophe.pedre...@gmail.com:
Hi all,
i have updated my rust compiler, i have several compilations errors on my
project
StrBuf does not exist any more, no problem, i now use String
~ is obsolete, no problem, i
Hi All,
sorry for my late replay, i am UTC+2
Won't wrapping the first `for` loop into curly braces help?
no
is this a database library you're writing yourself?
yes
My best guess here is that you've accidentally used the wrong lifetime on
your `execute_query()` method, tying the lifetime of
Hello all,
i know that this issue is already covered by issues #9113 #6393 and #9113
but actually i have no solution. My code is a library for accessing
databases. In my example, the database represented by db containes a table
t with columns i:integer, f:float, t:text, b:blob.
Everything works
I am trying to implement a Singleton (an object which instantiate only
once, successive instantiations returning the object itself).
Any tutorial for this ? any idea ? example ? best practice ?
thanks
___
Rust-dev mailing list
Rust-dev@mozilla.org
= if tmp.is_not_null {let tmp_str = tmp .as_str()}; tmp_str.clone() }
Thanks
2014-05-13 1:24 GMT+02:00 comex com...@gmail.com:
On Mon, May 12, 2014 at 6:41 PM, Christophe Pedretti
christophe.pedre...@gmail.com wrote:
Another SQLite function, sqlite3_column_text, return a *c_uchar; so,
tu use the CString new
Hi all,
SQLITE is defining the following C function :
int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*));
How to include it in an extern block ?
I have tried this
fn sqlite3_bind_text(pStmt : *mut(), iCol : c_int, value : *c_char, n
: c_int, f : *proc(*())) - c_int;
Hi all,
Vladimir suggested to use CString::new(sqlite3_errmsg(*ppDb), false)
and then as_str() on the CString in order to obtain a Rust String from
a *c_char.
Another SQLite function, sqlite3_column_text, return a *c_uchar; so,
tu use the CString new, which takes a *c_char as argument, i can
Hi all,
i am writing a wrapper to an SQLite database.
If i use :
extern { fn sqlite3_open(filename: *c_char, ppDb : **mut ()) - c_int; }
i can not use :
let ppDb : **mut () = RawPtr::null();
unsafe { res=sqlite3_open(filename.as_ptr(), ppDb);
because as_ptr() returns an *u8 and c_char is a i8,
Hi all,
thanks to Vladimir and Valerii for their previous detailed answer to
my email, now i have a more general question.
My Connection struct has a new method with open a connection to a
database. This connection can fails. Three possiblities :
1/ new returns an IoResultConnection. The
Hi all,
i would like to parse a file, line by line, and when a line finishes with
'\', the next line is considered as the continuation of the current line.
I Would like to wtite something like this
let mut multi = ~;
for line in BufferedReader::new(reader).lines() {
match line {
Ok(l) = {
multi
19 matches
Mail list logo