[−][src]Struct dgraph_tonic::Mutation
Fields
set_json: Vec<u8>
delete_json: Vec<u8>
set_nquads: Vec<u8>
del_nquads: Vec<u8>
set: Vec<NQuad>
del: Vec<NQuad>
cond: String
This is being used for upserts.
commit_now: bool
This field is a duplicate of the one in Request and placed here for convenience.
Implementations
impl Mutation
[src]
pub fn new() -> Self
[src]
Create new Dgraph Mutation object.
Mutation represent required modification of data in DB. Mutation provides two main ways to set data: JSON and RDF N-Quad. You can choose whichever way is convenient. JSON way has implemented to helper functions.
pub fn set_set_json<T: ?Sized>(&mut self, value: &T) -> Result<(), Error> where
T: Serialize,
[src]
T: Serialize,
Set set JSON data in Mutation.
Arguments
value
- ref to struct which can be serialized into JSON
Errors
Return serde_json:Error when value cannot be serialized to JSON format
Examples
use dgraph_tonic::Mutation; use serde::Serialize; #[derive(Serialize)] struct Person { uid: String, name: String, } let p = Person { uid: "_:alice".into(), name: "Alice".into(), }; let mut mu = Mutation::new(); mu.set_set_json(&p).expect("JSON");
pub fn set_delete_json<T: ?Sized>(&mut self, value: &T) -> Result<(), Error> where
T: Serialize,
[src]
T: Serialize,
Set delete JSON data in Mutation.
Arguments
value
- ref to struct which can be serialized into JSON
Errors
Return serde_json:Error when value cannot be serialized to JSON format
Examples
use dgraph_tonic::Mutation; use serde::Serialize; #[derive(Serialize)] struct Person { uid: String, name: Option<String>, } let p = Person { uid: "_:0x1".into(), name: None, }; let mut mu = Mutation::new(); //remove name predicate mu.set_delete_json(&p).expect("JSON");
pub fn set_set_nquads<S: Into<String>>(&mut self, nquads: S)
[src]
Set set Nquads in Mutation.
Arguments
nquads
- set nquads
Examples
use dgraph_tonic::Mutation; let mut mu = Mutation::new(); //remove name predicate mu.set_set_nquads(r#"uid(user) <email> "correct_email@dgraph.io" ."#);
pub fn set_delete_nquads<S: Into<String>>(&mut self, nquads: S)
[src]
Set delete Nquads in Mutation.
Arguments
nquads
- delete nquads
Examples
use dgraph_tonic::Mutation; let mut mu = Mutation::new(); //remove name predicate mu.set_set_nquads(r#"uid(user) <email> * ."#);
pub fn set_cond<S: Into<String>>(&mut self, cond: S)
[src]
Trait Implementations
impl Clone for Mutation
[src]
impl Debug for Mutation
[src]
impl Default for Mutation
[src]
impl Message for Mutation
[src]
fn encode_raw<B>(&self, buf: &mut B) where
B: BufMut,
[src]
B: BufMut,
fn merge_field<B>(
&mut self,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError> where
B: Buf,
[src]
&mut self,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError> where
B: Buf,
fn encoded_len(&self) -> usize
[src]
fn clear(&mut self)
[src]
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
[src]
B: BufMut,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
[src]
B: BufMut,
fn decode<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
[src]
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
[src]
B: Buf,
Self: Default,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
[src]
B: Buf,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
[src]
B: Buf,
impl PartialEq<Mutation> for Mutation
[src]
impl StructuralPartialEq for Mutation
[src]
Auto Trait Implementations
impl RefUnwindSafe for Mutation
impl Send for Mutation
impl Sync for Mutation
impl Unpin for Mutation
impl UnwindSafe for Mutation
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRequest<T> for T
[src]
fn into_request(self) -> Request<T>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,