Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Cannot declare a satisfiable feed reference

Đang mở
#69 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tài liệu
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
databases

Hướng nghiên cứu

Bắt đầu với ví dụ Feed::new được ghi trong tài liệu và các đoạn snippet về Feed và tham số hàm trong issue. Kiểm tra các chẩn đoán của trình biên dịch Rust và tài liệu hypercore hiện có để xác định kiểu feed được hỗ trợ và mô hình ownership. Hoàn tất khi tài liệu chỉ rõ cách lưu trữ một feed, truyền một feed vào hàm và khai báo kiểu của biến.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Question

Your Environment

Software Version(s)
hypercore 0.9.0
Rustc rustc 1.34.1 (fc50f328b 2019-04-24)
Operating System linux

Question

So I'm not sure if I should ask this question here. I have tried to find help elsewhere but writing here as a last-resort.
I'm new to rust and I have been picking up the language at a steady pace.
But there's one issue that I've been struggling with to the point of insanity.

How do you store a hypercore::Feed in a struct or define a function that can take a feed as a parameter?

// What is the correct type declaration for feed? 
pub struct MyStruct {
  m_feed: Feed<RandomAccess>,
}; 

pub fn (a_feed: &Feed<RandomAccess>) { ... }

// Or even slightly modifying the example from the docs:
let path = PathBuf::from("./my-first-dataset");
let mut feed: TYPE_DECLARATION = Feed::new(&path).unwrap();

I've literally spent a week trying all kinds of exotic declaration to satisfy the compiler traits, but to no avail..

Again humble apologies for asking this here, please help!

Ngôn ngữ chính
Rust
Star
356
Fork
36
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của datrs/hypercore

Tất cả issue của datrs/hypercore

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.