pub struct Content {Show 13 fields
pub name: String,
pub path: String,
pub sha: String,
pub encoding: Option<String>,
pub content: Option<String>,
pub size: i64,
pub url: String,
pub html_url: Option<String>,
pub git_url: Option<String>,
pub download_url: Option<String>,
pub type: String,
pub links: ContentLinks,
pub license: Option<License>,
}
Fields§
§name: String
§path: String
§sha: String
§encoding: Option<String>
§content: Option<String>
File content, Base64 encoded. See also Content::decoded_content.
size: i64
§url: String
§html_url: Option<String>
§git_url: Option<String>
§download_url: Option<String>
§type: String
§links: ContentLinks
§license: Option<License>
Implementations§
source§impl Content
impl Content
sourcepub fn decoded_content(&self) -> Option<String>
pub fn decoded_content(&self) -> Option<String>
Get content of a file from a repository.
let mut content = octocrab::instance()
.repos("owner", "repo")
.get_content()
.path("path/to/file")
.r#ref("main")
.send()
.await?;
let contents = content.take_items();
let c = &contents[0];
let decoded_content = c.decoded_content().unwrap();
Trait Implementations§
source§impl<'de> Deserialize<'de> for Content
impl<'de> Deserialize<'de> for Content
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
impl StructuralPartialEq for Content
Auto Trait Implementations§
impl Freeze for Content
impl RefUnwindSafe for Content
impl Send for Content
impl Sync for Content
impl Unpin for Content
impl UnwindSafe for Content
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> FromResponse for Twhere
T: DeserializeOwned,
impl<T> FromResponse for Twhere
T: DeserializeOwned,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more