pub struct File { /* private fields */ }Expand description
File block representation.
§Fields and Validations
For more details, see the official documentation.
| Field | Type | Required | Validation |
|---|---|---|---|
| external_id | String | Yes | N/A |
| source | FileSource | Yes | N/A |
| block_id | String | No | Maximum 255 characters |
§Example
let file = File::builder()
.external_id("ABCD1")
.source(FileSource::Remote)
.build()?;
let expected = serde_json::json!({
"type": "file",
"external_id": "ABCD1",
"source": "remote"
});
let json = serde_json::to_value(file).unwrap();
assert_eq!(json, expected);Implementations§
Source§impl File
impl File
Sourcepub fn builder() -> FileBuilder
pub fn builder() -> FileBuilder
constract FileBuilder object.
Trait Implementations§
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)