Skip to content

Commit

Permalink
Merge pull request #406 from AlexTMjugador/feat/non-consuming-doc-to-…
Browse files Browse the repository at this point in the history
…json

Add non-consuming `as_json` method to `Document` struct
  • Loading branch information
alteous authored Jan 25, 2024
2 parents defae93 + 300927f commit d7750db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ impl Document {
self.0
}

/// Unwraps the glTF document, without consuming it.
pub fn as_json(&self) -> &json::Root {
&self.0
}

/// Perform validation checks on loaded glTF.
pub(crate) fn validate(&self) -> Result<()> {
use json::validation::Validate;
Expand Down

0 comments on commit d7750db

Please sign in to comment.