pub struct SessionDepend { /* private fields */ }

Implementations§

Examples found in repository?
src/relation.rs (lines 104-110)
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
    pub fn depends(&self, key: Option<&str>, pend: &CollectionRow) -> Vec<SessionDepend> {
        let mut ret: Vec<SessionDepend> = Vec::new();
        if let Some(key_name) = key {
            if let Some(key) = self.key_names.find_row(key_name.as_bytes()) {
                let c = self.rows.pend.select_by_value(pend);
                for i in c {
                    if let (Some(key_row), Some(collection_row)) =
                        (self.rows.key.value(i), self.rows.pend.value(i))
                    {
                        if key_row == key {
                            ret.push(SessionDepend::new(
                                key_name,
                                SessionCollectionRow::new(
                                    collection_row.collection_id(),
                                    collection_row.row() as i64,
                                ),
                            ));
                        }
                    }
                }
            }
        } else {
            let c = self.rows.pend.select_by_value(pend);
            for i in c {
                if let (Some(key), Some(collection_row)) =
                    (self.rows.key.value(i), self.rows.pend.value(i))
                {
                    ret.push(SessionDepend::new(
                        unsafe { self.key_names.str(key) },
                        SessionCollectionRow::new(
                            collection_row.collection_id(),
                            collection_row.row() as i64,
                        ),
                    ));
                }
            }
        }
        ret
    }
More examples
Hide additional examples
src/session.rs (line 263)
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
    pub fn depends(&self, key: Option<&str>, pend_row: u32) -> Option<Vec<SessionDepend>> {
        let mut r = vec![];
        if let Some(ref session_data) = self.session_data {
            if let Some(key_name) = key {
                if let Some(key_id) = session_data
                    .relation
                    .key_names
                    .find_row(key_name.as_bytes())
                {
                    for relation_row in session_data
                        .relation
                        .rows
                        .session_row
                        .select_by_value(&pend_row)
                        .iter()
                    {
                        if let (Some(key), Some(depend)) = (
                            session_data.relation.rows.key.value(*relation_row),
                            session_data.relation.rows.depend.value(*relation_row),
                        ) {
                            if key == key_id {
                                r.push(SessionDepend::new(key_name, depend));
                            }
                        }
                    }
                    return Some(r);
                }
            } else {
                for relation_row in session_data
                    .relation
                    .rows
                    .session_row
                    .select_by_value(&pend_row)
                    .iter()
                {
                    if let (Some(key), Some(depend)) = (
                        session_data.relation.rows.key.value(*relation_row),
                        session_data.relation.rows.depend.value(*relation_row),
                    ) {
                        r.push(SessionDepend::new(
                            unsafe { session_data.relation.key_names.str(key) },
                            depend,
                        ));
                    }
                }
                return Some(r);
            }
        }
        None
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.