pub struct ContentEntry {
pub content_type: ContentType,
pub encoding: Option<String>,
pub size: u64,
pub name: String,
pub path: String,
pub content: Option<String>,
pub sha: String,
pub download_url: Option<String>,
pub html_url: Option<String>,
pub url: Option<String>,
pub target: Option<String>,
pub submodule_git_url: Option<String>,
}Expand description
A content entry (file or directory) in a repository.
Fields§
§content_type: ContentTypeEntry type.
encoding: Option<String>Encoding (e.g., “base64” for file content).
size: u64Size in bytes (0 for directories).
name: StringEntry name (filename or directory name).
path: StringFull path from repository root.
content: Option<String>Base64-encoded content (only for files when requested).
sha: StringGit object SHA.
download_url: Option<String>URL to download raw content.
html_url: Option<String>URL to view in web UI.
url: Option<String>API URL for this entry.
target: Option<String>Symlink target (only for symlinks).
submodule_git_url: Option<String>Submodule URL (only for submodules).
Implementations§
Source§impl ContentEntry
impl ContentEntry
Sourcepub fn file(name: String, path: String, sha: String, size: u64) -> Self
pub fn file(name: String, path: String, sha: String, size: u64) -> Self
Create a new file entry.
Sourcepub fn symlink(name: String, path: String, sha: String, target: String) -> Self
pub fn symlink(name: String, path: String, sha: String, target: String) -> Self
Create a new symlink entry.
Sourcepub fn submodule(
name: String,
path: String,
sha: String,
git_url: String,
) -> Self
pub fn submodule( name: String, path: String, sha: String, git_url: String, ) -> Self
Create a new submodule entry.
Sourcepub fn with_content(self, content: String) -> Self
pub fn with_content(self, content: String) -> Self
Set the content (base64-encoded).
Trait Implementations§
Source§impl Clone for ContentEntry
impl Clone for ContentEntry
Source§fn clone(&self) -> ContentEntry
fn clone(&self) -> ContentEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContentEntry
impl Debug for ContentEntry
Source§impl<'de> Deserialize<'de> for ContentEntry
impl<'de> Deserialize<'de> for ContentEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ContentEntry
impl RefUnwindSafe for ContentEntry
impl Send for ContentEntry
impl Sync for ContentEntry
impl Unpin for ContentEntry
impl UnsafeUnpin for ContentEntry
impl UnwindSafe for ContentEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more