How prevent rule execution if schema validation did not passed?

I have the code

class PostSchema < Dry::Validation::Contract
  params do
    required(:title).value(:string, size: 20)
    required(:content).value(:string, size: 50)
  end 
  
  rule do 
     # prevent this rule to execute if shema validation did not passed
  end
end

My current work around is use result.schema_result.success?. Even this working but I look at the source code at https://github.com/dry-rb/dry-validation/blob/master/lib/dry/validation/result.rb#L41. It is private api. Anyone has any idea about this?

@Uysim the easiest solution will be to base your rule on one or more schema keys. For example:

class PostSchema < Dry::Validation::Contract
  params do
    required(:title).value(:string, size: 20)
    required(:content).value(:string, size: 50)
  end 

  rule(:title, :content) do 
     # this will run only if schema processes these keys successfuly
  end
end

Actually, it is the same way as I used to do. The problem here if we need one more field then we need to maintain those keys