소스 정보
- 저장소
- pluginagentmarketplace/custom-plugin-rust
- 최근 소스 활동
- 2025년 12월 30일 04:25
- 감지된 SKILL.md 언어
- 영어
- 스타
- 1
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-rust --skill ownership-borrowing명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | ownership-borrowing |
| description | Master Rust's ownership, borrowing, and lifetime system |
| sasmp_version | 1.3.0 |
| bonded_agent | rust-fundamentals-agent |
| bond_type | PRIMARY_BOND |
| version | 1.0.0 |
Master Rust's revolutionary memory safety system without garbage collection.
// Rule 1: Each value has exactly ONE owner
let s1 = String::from("hello"); // s1 owns this String
// Rule 2: Only ONE owner at a time
let s2 = s1; // Ownership MOVES to s2
// println!("{}", s1); // ERROR: s1 no longer valid
// Rule 3: Value is dropped when owner goes out of scope
{
let s3 = String::from("temporary");
} // s3 dropped here, memory freed
fn main() {
let s = String::from("hello");
// Immutable borrow
let len = calculate_length(&s);
println!("{} has length {}", s, len);
// Mutable borrow
let mut s = String::from("hello");
change(&mut s);
println!("{}", s); // "hello, world"
}
fn calculate_length(s: &String) -> usize {
s.len()
}
fn change(s: &mut String) {
s.push_str(", world");
}
// Explicit lifetime annotation
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
if x.len() > y.len() { x } else { y }
}
// Struct with lifetime
struct Excerpt<'a> {
part: &'a str,
}
let s1 = String::from("hello");
let s2 = s1.clone(); // Deep copy
println!("{} {}", s1, s2); // Both valid
fn process(s: String) -> String {
// Do something with s
s // Return ownership
}
fn analyze(data: &Vec<i32>) -> Summary {
// Only read, don't own
Summary::from(data)
}
// Problem
let s = String::from("hello");
let s2 = s;
println!("{}", s); // ERROR
// Solution 1: Clone
let s2 = s.clone();
// Solution 2: Borrow
let s2 = &s;
// Problem
let s = String::from("hello");
change(&mut s); // ERROR: s is not mut
// Solution: Declare as mutable
let mut s = String::from("hello");
change(&mut s); // OK
SOC 직업 분류 기준