GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lifetime bounded TryFromBorrwoedObject · RustPython/RustPython@f314328

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • examples
    • call_between_rust_and_python.rs
  • stdlib/src
    • mmap.rs
    • resource.rs
    • unicodedata.rs
    • zlib.rs
  • vm/src
    • builtins
      • bool.rs
      • bytes.rs
      • int.rs
      • str.rs
    • bytesinner.rs
    • convert
      • try_from.rs
    • function
      • buffer.rs
      • mod.rs
    • protocol
      • buffer.rs
    • stdlib
      • time.rs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎examples/call_between_rust_and_python.rs‎

Copy file name to clipboardExpand all lines: examples/call_between_rust_and_python.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ python_person.name: {}",
8686
name: String,
8787
}
8888

89-
impl TryFromBorrowedObject for PythonPerson {
90-
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &PyObject) -> PyResult<Self> {
89+
impl<'a> TryFromBorrowedObject<'a> for PythonPerson {
90+
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> {
9191
let name = obj.get_attr("name", vm)?.try_into_value::<String>(vm)?;
9292
Ok(PythonPerson { name })
9393
}
Collapse file

‎stdlib/src/mmap.rs‎

Copy file name to clipboardExpand all lines: stdlib/src/mmap.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ mod mmap {
7272
Copy = 3,
7373
}
7474

75-
impl TryFromBorrowedObject for AccessMode {
76-
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &PyObject) -> PyResult<Self> {
75+
impl<'a> TryFromBorrowedObject<'a> for AccessMode {
76+
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> {
7777
let i = u32::try_from_borrowed_object(vm, obj)?;
7878
Ok(match i {
7979
0 => Self::Default,
Collapse file

‎stdlib/src/resource.rs‎

Copy file name to clipboardExpand all lines: stdlib/src/resource.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ mod resource {
129129
}
130130

131131
struct Limits(libc::rlimit);
132-
impl TryFromBorrowedObject for Limits {
133-
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &PyObject) -> PyResult<Self> {
132+
impl<'a> TryFromBorrowedObject<'a> for Limits {
133+
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> {
134134
let seq: Vec<libc::rlim_t> = obj.try_to_value(vm)?;
135135
match *seq {
136136
[cur, max] => Ok(Self(libc::rlimit {
Collapse file

‎stdlib/src/unicodedata.rs‎

Copy file name to clipboardExpand all lines: stdlib/src/unicodedata.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ enum NormalizeForm {
4141
Nfkd,
4242
}
4343

44-
impl TryFromBorrowedObject for NormalizeForm {
45-
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &PyObject) -> PyResult<Self> {
44+
impl<'a> TryFromBorrowedObject<'a> for NormalizeForm {
45+
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> {
4646
obj.try_value_with(
4747
|form: &PyStr| {
4848
Ok(match form.as_str() {
Collapse file

‎stdlib/src/zlib.rs‎

Copy file name to clipboardExpand all lines: stdlib/src/zlib.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,8 @@ mod zlib {
581581
}
582582
}
583583

584-
impl TryFromBorrowedObject for Level {
585-
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &PyObject) -> PyResult<Self> {
584+
impl<'a> TryFromBorrowedObject<'a> for Level {
585+
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> {
586586
let int: i32 = obj.try_index(vm)?.try_to_primitive(vm)?;
587587
Ok(Self::new(int))
588588
}
Collapse file

‎vm/src/builtins/bool.rs‎

Copy file name to clipboardExpand all lines: vm/src/builtins/bool.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ impl ToPyObject for bool {
1919
}
2020
}
2121

22-
impl TryFromBorrowedObject for bool {
23-
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &PyObject) -> PyResult<bool> {
22+
impl<'a> TryFromBorrowedObject<'a> for bool {
23+
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<bool> {
2424
if obj.fast_isinstance(vm.ctx.types.int_type) {
2525
Ok(get_value(obj))
2626
} else {
Collapse file

‎vm/src/builtins/bytes.rs‎

Copy file name to clipboardExpand all lines: vm/src/builtins/bytes.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,8 @@ impl IterNext for PyBytesIterator {
742742
}
743743
}
744744

745-
impl TryFromBorrowedObject for PyBytes {
746-
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &PyObject) -> PyResult<Self> {
745+
impl<'a> TryFromBorrowedObject<'a> for PyBytes {
746+
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> {
747747
PyBytesInner::try_from_borrowed_object(vm, obj).map(|x| x.into())
748748
}
749749
}
Collapse file

‎vm/src/builtins/int.rs‎

Copy file name to clipboardExpand all lines: vm/src/builtins/int.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ impl_into_pyobject_int!(isize i8 i16 i32 i64 i128 usize u8 u16 u32 u64 u128 BigI
7272

7373
macro_rules! impl_try_from_object_int {
7474
($(($t:ty, $to_prim:ident),)*) => {$(
75-
impl TryFromBorrowedObject for $t {
76-
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &PyObject) -> PyResult<Self> {
75+
impl<'a> TryFromBorrowedObject<'a> for $t {
76+
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> {
7777
obj.try_value_with(|int: &PyInt| {
7878
int.try_to_primitive(vm)
7979
}, vm)
Collapse file

‎vm/src/builtins/str.rs‎

Copy file name to clipboardExpand all lines: vm/src/builtins/str.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ use unic_ucd_category::GeneralCategory;
4242
use unic_ucd_ident::{is_xid_continue, is_xid_start};
4343
use unicode_casing::CharExt;
4444

45-
impl TryFromBorrowedObject for String {
46-
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &PyObject) -> PyResult<Self> {
45+
impl<'a> TryFromBorrowedObject<'a> for String {
46+
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> {
4747
obj.try_value_with(|pystr: &PyStr| Ok(pystr.as_str().to_owned()), vm)
4848
}
4949
}
Collapse file

‎vm/src/bytesinner.rs‎

Copy file name to clipboardExpand all lines: vm/src/bytesinner.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ impl From<Vec<u8>> for PyBytesInner {
3030
}
3131
}
3232

33-
impl TryFromBorrowedObject for PyBytesInner {
34-
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &PyObject) -> PyResult<Self> {
33+
impl<'a> TryFromBorrowedObject<'a> for PyBytesInner {
34+
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> {
3535
bytes_from_object(vm, obj).map(Self::from)
3636
}
3737
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.